SDL_ttf-2.0.10


详细信息你们都知道了,我这里也不多废话了,对你们有用的就拿走
资源截图
代码片段和文件信息
/*
    glfont:  An example of using the SDL_ttf library with OpenGL.
    Copyright (C) 1997-2009 Sam Lantinga

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License or (at your option) any later version.

    This library 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
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not write to the Free
    Foundation Inc. 59 Temple Place Suite 330 Boston MA  02111-1307  USA

    The SDL_GL_* functions in this file are available in the public domain.

    Sam Lantinga
    slouken@libsdl.org
*/

/* $Id: glfont.c 4463 2009-03-22 06:54:13Z slouken $ */

/* A simple program to test the text rendering feature of the TTF library */

#include 
#include 
#include 

#include “SDL.h“
#include “SDL_ttf.h“

#ifdef HAVE_OPENGL

#include “SDL_opengl.h“

#define DEFAULT_PTSIZE 18
#define DEFAULT_TEXT “The quick brown fox jumped over the lazy dog“
#define NUM_COLORS      256

static char *Usage =
“Usage: %s [-utf8|-unicode] [-b] [-i] [-u] [-fgcol rgb] [-bgcol rgb] 
.ttf [ptsize] [text]
“;

void SDL_GL_Enter2DMode()
{
SDL_Surface *screen = SDL_GetVideoSurface();

/* Note there may be other things you need to change
   depending on how you have your OpenGL state set up.
*/
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glEnable(GL_TEXTURE_2D);

/* This allows alpha blending of 2D textures with the scene */
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA);

glViewport(0 0 screen->w screen->h);

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();

glOrtho(0.0 (GLdouble)screen->w (GLdouble)screen->h 0.0 0.0 1.0);

glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();

glTexEnvf(GL_TEXTURE_ENV GL_TEXTURE_ENV_MODE GL_MODULATE);
}

void SDL_GL_Leave2DMode()
{
glMatrixMode(GL_MODELVIEW);
glPopMatrix();

glMatrixMode(GL_PROJECTION);
glPopMatrix();

glPopAttrib();
}

/* Quick utility function for texture creation */
static int power_of_two(int input)
{
int value = 1;

while ( value < input ) {
value <<= 1;
}
return value;
}

GLuint SDL_GL_LoadTexture(SDL_Surface *surface GLfloat *texcoord)
{
GLuint texture;
int w h;
SDL_Surface *image;
SDL_Rect area;
Uint32 saved_flags;
Uint8  saved_alpha;

/* Use the surface width and height expanded to powers of 2 */
w = power_of_two(surface->w);
h = power_of_two(surface->h);
texcoord[0] = 0.0f; /* Min X */
texcoord[1] = 0.0f; /* Min Y */
texcoord[2] = (GLfloat)surface->w / w; /* Max X */
texcoord[3] = (GL

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4393  2013-11-07 18:10  SDL_ttf-2.0.10.depsglfont.Po

     文件       7160  2013-11-07 18:10  SDL_ttf-2.0.10.depsSDL_ttf.Plo

     文件       4191  2013-11-07 18:10  SDL_ttf-2.0.10.depsshowfont.Po

     文件      30932  2013-11-07 18:10  SDL_ttf-2.0.10.libsglfont

     文件      62176  2013-12-10 13:02  SDL_ttf-2.0.10.libslibSDL_ttf-2.0.so.0

     文件      62176  2013-11-07 18:10  SDL_ttf-2.0.10.libslibSDL_ttf-2.0.so.0.10.0

     文件      66786  2013-11-07 18:10  SDL_ttf-2.0.10.libslibSDL_ttf.a

     文件       1032  2013-12-10 13:02  SDL_ttf-2.0.10.libslibSDL_ttf.la

     文件       1033  2013-11-07 18:10  SDL_ttf-2.0.10.libslibSDL_ttf.lai

     文件      62176  2013-12-10 13:02  SDL_ttf-2.0.10.libslibSDL_ttf.so

     文件      67492  2013-11-07 18:10  SDL_ttf-2.0.10.libsSDL_ttf.o

     文件      28386  2013-11-07 18:10  SDL_ttf-2.0.10.libsshowfont

     文件     260205  2009-10-13 07:06  SDL_ttf-2.0.10acincludelibtool.m4

     文件      12018  2009-10-13 07:06  SDL_ttf-2.0.10acincludeltoptions.m4

     文件       4452  2009-10-13 07:06  SDL_ttf-2.0.10acincludeltsugar.m4

     文件        781  2009-10-13 07:06  SDL_ttf-2.0.10acincludeltversion.m4

     文件       5786  2009-10-13 07:06  SDL_ttf-2.0.10acincludelt~obsolete.m4

     文件       5221  2009-10-13 07:06  SDL_ttf-2.0.10acincludepkg.m4

     文件       6996  2009-10-13 07:06  SDL_ttf-2.0.10acincludesdl.m4

     文件      34850  2009-10-19 16:18  SDL_ttf-2.0.10aclocal.m4

     文件        167  2009-10-13 07:06  SDL_ttf-2.0.10autogen.sh

     文件       5748  2009-10-19 16:18  SDL_ttf-2.0.10CHANGES

     文件      44702  2009-10-13 07:06  SDL_ttf-2.0.10config.guess

     文件      25503  2013-11-07 18:09  SDL_ttf-2.0.10config.log

     文件      56160  2013-11-07 18:09  SDL_ttf-2.0.10config.status

     文件      34334  2009-10-13 07:06  SDL_ttf-2.0.10config.sub

     文件     488882  2009-10-19 16:18  SDL_ttf-2.0.10configure

     文件       4802  2009-10-13 07:06  SDL_ttf-2.0.10configure.in

     文件      24390  2009-10-13 07:06  SDL_ttf-2.0.10COPYING

     文件      18615  2009-10-19 16:18  SDL_ttf-2.0.10depcomp

............此处省略36个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)