- Código: Seleccionar todo
//Lost in Castle
//Version 1.0 BETA
//Alejandro Martinez
#include <SDL/SDL.h>
#include <iostream>
#include <stdio.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_mixer.h>
#include "recursos.h"
int main ( int argc, char** argv ){
SDL_Color fgcolor;
fgcolor.r=200;
fgcolor.g=200;
fgcolor.b=10;
SDL_Event event;
SDL_Rect dest;
TTF_Font *fuente;
SDL_Surface *screen,txt;
SDL_Surface *UI;
SDL_Surface *tu;
int proceso =0;
int raza=3;
;
//razas: 1HUMANO,2ORCO,3ELFO
iniciar_sdl();
screen = SDL_SetVideoMode(800, 600, 32, SDL_HWSURFACE | SDL_ANYFORMAT | SDL_DOUBLEBUF);
if ( !screen )
{
printf("Error 1x01: %s\n", SDL_GetError());
}
if (TTF_Init() < 0) {
printf("Error 1x02: %s\n",SDL_GetError());
return 1;
}
fuente=TTF_OpenFont("framd.ttf",20);
void TTF_Close(TTF_Font *fuente);
txt = TTF_RenderText_Solid(fuente,"hola",fgcolor);
SDL_WM_SetCaption("Lost In Castle", NULL);
////////////////////////////////////////
UI = IMG_Load ("img/UI.png");
dest.x=0;
dest.y=500;
SDL_BlitSurface(UI, NULL, screen, &dest); //copiamos img en screen
SDL_Flip(screen);
while(!proceso){
if(raza=3){
tu = IMG_Load ("img/elfo.png");
dest.x=80;
dest.y=530;
SDL_BlitSurface(tu, NULL, screen, &dest); //copiamos img en screen
SDL_Flip(screen);
while(SDL_PollEvent(&event)){
if(event.type == SDL_KEYDOWN){
if(event.key.keysym.sym == SDLK_ESCAPE){
SDL_Quit();
return 0;
}
}
}
}
}
}
y este es mi maldito error que no se como solucionar T_T
44 C:\Users\Alex\Desktop\Lost in castle\main.cpp no match for 'operator=' in 'txt = TTF_RenderText_Solid(fuente, ((const char*)"hola"), fgcolor)'