小编use*_*209的帖子

无法找到SDL_ttf无法渲染的原因

我使用的是代码块,我已经安装了librares,并且没有错误......当我构建项目时,编译器说它没有错误,当我运行它时,它只是弹出一个窗口,里面只是黑色,和它假设出现"Hola Mundo ..."这个词我在项目文件夹中得到了ariblk.ttf ...

#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>
#include "SDL_ttf.h"

int main(int argc, char *argv[]) {

SDL_Color bgcolor,fgcolor;
SDL_Rect rectangulo;
SDL_Surface *screen,*ttext;
TTF_Font *fuente;
const char texto[14]="Hola Mundo...";
char msg[14];
SDL_Event event;
int done = 0;

if (SDL_Init(SDL_INIT_VIDEO) < 0) {
printf("No se pudo iniciar SDL: %s\n",SDL_GetError());
return 1;
}

screen = SDL_SetVideoMode(640,480,24,SDL_HWSURFACE|SDL_DOUBLEBUF);
if (screen == NULL) {
printf("No se puede inicializar el modo gráfico: %s\n",SDL_GetError());
return 1;
}
atexit(SDL_Quit);

if (TTF_Init() < 0) {
printf("No se pudo …
Run Code Online (Sandbox Code Playgroud)

c sdl codeblocks

1
推荐指数
1
解决办法
204
查看次数

标签 统计

c ×1

codeblocks ×1

sdl ×1