Skip to content
Snippets Groups Projects
Commit 150cc417 authored by dg's avatar dg
Browse files

Fix text lines on very large screens

git-svn-id: http://svn.net-core.org/repos/t-engine4@4388 51575b47-30f0-44d4-a5cc-537603b46e54
parent 96c5478d
No related branches found
No related tags found
No related merge requests found
......@@ -566,6 +566,7 @@ static font_make_texture_line(lua_State *L, SDL_Surface *s, int id, bool is_sepa
lua_rawseti(L, -2, id);
}
extern GLint max_texture_size;
static int sdl_font_draw(lua_State *L)
{
TTF_Font **f = (TTF_Font**)auxiliar_checkclass(L, "sdl{font}", 1);
......@@ -578,7 +579,9 @@ static int sdl_font_draw(lua_State *L)
int h = TTF_FontLineSkip(*f);
SDL_Color color = {r,g,b};
if (max_width >= 1024) max_width = 1024;
int fullmax = max_texture_size / 2;
if (fullmax < 1024) fullmax = 1024;
if (max_width >= fullmax) max_width = fullmax;
Uint32 rmask, gmask, bmask, amask;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
......
......@@ -74,6 +74,7 @@ SDL_TimerID display_timer_id = NULL;
SDL_TimerID realtime_timer_id = NULL;
/* OpenGL capabilities */
GLint max_texture_size = 1024;
extern bool shaders_active;
bool fbo_active;
bool multitexture_active;
......@@ -725,9 +726,8 @@ int resizeWindow(int width, int height)
SDL_SetGamma(gamma_correction, gamma_correction, gamma_correction);
GLint texSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);
printf("OpenGL max texture size: %d\n", texSize);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
printf("OpenGL max texture size: %d\n", max_texture_size);
return( TRUE );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment