//! Render text to texture (PC_SDL only) /* * MotorJ in-game text to surface subroutines * Header file * * (C) 2007-2010 Alejandro Valenzuela Roca * * This file is part of MotorJ, a free framework for videogame creation. * * * * MotorJ is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MotorJ is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MotorJ. If not, see . */ #ifndef TEXTRENDER_H #define TEXTRENDER_H #ifndef NINTENDO_DS #ifndef NINTENDO_WII // FIXME: Should not be auto-compiled in Nintendo DS #ifdef VISUAL_STUDIO #include #endif #ifndef GL_H #define GL_H #include #endif #ifndef GLU_H #define GLU_H #include #endif #ifndef SDL_H #define SDL_H #include #endif #ifndef SDL_TTF_H #define SDL_TTF_H #include #endif #include "support.h" //! Text surface structure typedef struct { //! GL Texture name GLuint glTexName; //! GL Texture coordinates float texcoords[2]; float ratio; GLuint width; GLuint height; GLuint innerwidth; GLuint innerheight; //! Bytes per pixel (Usually 4: RGB and Alpha channel) GLuint Bpp; } MJTextSurface; //! Create or update a text texture from a UTF8 text MJTextSurface * mjRenderText(bool Blended, char * UTF8txt, int maxwidth, TTF_Font * font_ttf, vector3 * color, MJTextSurface * srfc); // The next functions are likely to disappear, do not use //GLubyte * copySFC_RGBAToGLUBYTEARRAY(SDL_Surface * src, int w, int h); //void copySFCToSFC_RGBA(SDL_Surface * src, SDL_Surface * dst); #endif #endif #endif