You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spOSMroute/sdlgl/sdl_port.h

84 lines
2.0 KiB

/***************************************************************************
* gl_port.h
*
* Thu Jul 19 19:00:10 2007
* Copyright 2007 Steffen Pohle
* steffen@gulpe.de
****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _SDL_PORT_H_
#define _SDL_PORT_H_
#define GL_GLEXT_PROTOTYPES 1
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glext.h>
#include <GL/glu.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include <SDL.h>
/*****************************************************************************
* gfx stuff...
*/
struct color {
unsigned short int r;
unsigned short int g;
unsigned short int b;
struct {
float r;
float g;
float b;
} c;
int alloc;
};
struct image {
int width;
int height;
GLuint txt_id; // texture id
GLuint rbo_id; // renderbuffer object id
GLuint fbo_id; // framebuffer id
int img_id; // internal gfx value for setting glViweport and glOrtho
uint8_t *data; // raw pixeldata (mostly used on opengl)
int data_fmt; // raw data format
};
struct font {
FT_Face face;
unsigned char *buffer;
int buffersize;
};
extern int font_init ();
extern struct font *font_load (char *name);
extern void font_draw (struct font *f, char *text, float x, float y, float sx, float sy);
#include "draw.h"
#endif