diff --git a/Source/Project64-video/Renderer/OGLEScombiner.cpp b/Source/Project64-video/Renderer/OGLEScombiner.cpp index 419e0e588..eb9675123 100644 --- a/Source/Project64-video/Renderer/OGLEScombiner.cpp +++ b/Source/Project64-video/Renderer/OGLEScombiner.cpp @@ -293,7 +293,7 @@ void init_combiner() // Creating a fake texture glBindTexture(GL_TEXTURE_2D, default_texture); - glTexImage2D(GL_TEXTURE_2D, 0, 3, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture); + //glTexImage2D(GL_TEXTURE_2D, 0, 3, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); diff --git a/Source/Project64-video/Renderer/OGLESglitchmain.cpp b/Source/Project64-video/Renderer/OGLESglitchmain.cpp index f2ebcc1c2..8342e29a8 100644 --- a/Source/Project64-video/Renderer/OGLESglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLESglitchmain.cpp @@ -139,9 +139,9 @@ int buffer_cleared; // Comment by Ziggy // To allocate a new static texture name, take the value (free_texture++) int free_texture; -int default_texture; // The infamous "32*1024*1024" is now configurable +GLuint default_texture; // The infamous "32*1024*1024" is now configurable int current_texture; -int depth_texture, color_texture; +GLuint depth_texture, color_texture; int glsl_support = 1; int viewport_width, viewport_height, g_viewport_offset = 0, nvidia_viewport_hack = 0; int save_w, save_h; @@ -319,9 +319,9 @@ bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_loc // Allocate static texture names // The initial value should be big enough to support the maximal resolution free_texture = 32 * 2048 * 2048; - default_texture = free_texture++; - color_texture = free_texture++; - depth_texture = free_texture++; + glGenTextures(1, &default_texture); + glGenTextures(1, &color_texture); + glGenTextures(1, &depth_texture); WriteTrace(TraceGlitch, TraceDebug, "color_format: %d, origin_location: %d, nColBuffers: %d, nAuxBuffers: %d", color_format, origin_location, nColBuffers, nAuxBuffers); WriteTrace(TraceGlitch, TraceDebug, "g_width: %d, g_height: %d fullscreen: %d", g_width, g_height, fullscreen); diff --git a/Source/Project64-video/Renderer/glitchmain.h b/Source/Project64-video/Renderer/glitchmain.h index b39db13c3..4e72d4776 100644 --- a/Source/Project64-video/Renderer/glitchmain.h +++ b/Source/Project64-video/Renderer/glitchmain.h @@ -20,26 +20,6 @@ extern int dumping; #include #include "types.h" -#define zscale 1.0f - -// VP added this utility function -// Returns the bytes per pixel of a given GR texture format -int grTexFormatSize(int fmt); - -// 03/07/2015 Comment by cxd4 -- regulated GL state machine debugging using glGetError -extern int grDisplayGLError(const char* message); - -extern int packed_pixels_support; -extern int ati_sucks; -extern float largest_supported_anisotropy; - -extern int default_texture; // The infamous "32*1024*1024" is now configurable -extern int depth_texture; -void set_depth_shader(); -void set_bw_shader(); -extern float invtex[2]; -extern int buffer_cleared; // Mark that the buffer has been cleared, used to check if we need to reload the texture buffer content - #ifdef _WIN32 #include typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC hdc); @@ -87,6 +67,26 @@ extern "C" { } #endif +#define zscale 1.0f + +// VP added this utility function +// Returns the bytes per pixel of a given GR texture format +int grTexFormatSize(int fmt); + +// 03/07/2015 Comment by cxd4 -- regulated GL state machine debugging using glGetError +extern int grDisplayGLError(const char* message); + +extern int packed_pixels_support; +extern int ati_sucks; +extern float largest_supported_anisotropy; + +extern GLuint default_texture; // The infamous "32*1024*1024" is now configurable +extern GLuint depth_texture; +void set_depth_shader(); +void set_bw_shader(); +extern float invtex[2]; +extern int buffer_cleared; // Mark that the buffer has been cleared, used to check if we need to reload the texture buffer content + void init_geometry(); void init_textures(); void init_combiner();