Skip to content
Snippets Groups Projects
Commit 1356d273 authored by dg's avatar dg
Browse files

check for multitexturing to use glActiveTexture call

git-svn-id: http://svn.net-core.org/repos/t-engine4@824 51575b47-30f0-44d4-a5cc-537603b46e54
parent eb52af7e
No related branches found
No related tags found
No related merge requests found
......@@ -51,8 +51,11 @@ bool exit_engine = FALSE;
bool no_sound = FALSE;
bool isActive = TRUE;
bool tickPaused = FALSE;
/* OpenGL capabilities */
extern bool shaders_active;
bool fbo_active;
bool multitexture_active;
/* Some lua stuff that's external but has no headers */
int luaopen_mime_core(lua_State *L);
......@@ -596,8 +599,10 @@ int main(int argc, char *argv[])
resizeWindow(WIDTH, HEIGHT);
// Get OpenGL capabilities
multitexture_active = glewIsSupported("GL_ARB_multitexture");
shaders_active = glewIsSupported("GL_ARB_shader_objects");
fbo_active = glewIsSupported("GL_EXT_framebuffer_object") || glewIsSupported("GL_ARB_framebuffer_object");
if (!multitexture_active) shaders_active = FALSE;
boot_lua(2, FALSE, argc, argv);
......
......@@ -24,6 +24,7 @@
extern int resizeWindow(int width, int height);
extern void do_resize(int w, int h, bool fullscreen);
extern bool fbo_active;
extern bool multitexture_active;
#endif
......@@ -26,6 +26,7 @@
#include "auxiliar.h"
#include "types.h"
#include "map.h"
#include "main.h"
#include "script.h"
//#include "shaders.h"
......@@ -423,7 +424,7 @@ void display_map_quad(map_type *map, int dx, int dy, map_object *m, int i, int j
if (m->shader) useShader(m->shader, i, j, a);
for (z = (!shaders_active) ? 0 : (m->nb_textures - 1); z >= 0; z--)
{
if (shaders_active) glActiveTexture(GL_TEXTURE0+z);
if (multitexture_active && shaders_active) glActiveTexture(GL_TEXTURE0+z);
glBindTexture(m->textures_is3d[z] ? GL_TEXTURE_3D : GL_TEXTURE_2D, m->textures[z]);
}
glBegin(GL_QUADS);
......
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