mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-26 10:29:23 +01:00
make sure all required functions are available
This commit is contained in:
parent
ac6221a68a
commit
0a5e4854d4
@ -22,6 +22,7 @@
|
|||||||
#include "surface.h"
|
#include "surface.h"
|
||||||
|
|
||||||
const GLchar *PaletteVertShaderSrc =
|
const GLchar *PaletteVertShaderSrc =
|
||||||
|
"//Vertex shader\n"
|
||||||
"#version 110\n"
|
"#version 110\n"
|
||||||
"varying vec2 TexCoord0; \n"
|
"varying vec2 TexCoord0; \n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -82,7 +83,9 @@ DWORD WINAPI render_main(void)
|
|||||||
int tex_size = tex_width * tex_height * sizeof(int);
|
int tex_size = tex_width * tex_height * sizeof(int);
|
||||||
int *tex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, tex_size);
|
int *tex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, tex_size);
|
||||||
|
|
||||||
GLuint paletteConvProgram = OpenGL_BuildProgram(&PaletteVertShaderSrc, &PaletteFragShaderSrc);
|
GLuint paletteConvProgram = 0;
|
||||||
|
if (glGetUniformLocation && glActiveTexture && glUniform1i)
|
||||||
|
paletteConvProgram = OpenGL_BuildProgram(&PaletteVertShaderSrc, &PaletteFragShaderSrc);
|
||||||
|
|
||||||
// primary surface texture
|
// primary surface texture
|
||||||
GLuint surfaceTexId = 0;
|
GLuint surfaceTexId = 0;
|
||||||
@ -143,7 +146,7 @@ DWORD WINAPI render_main(void)
|
|||||||
if (ddraw->render.maxfps > 0)
|
if (ddraw->render.maxfps > 0)
|
||||||
tick_start = timeGetTime();
|
tick_start = timeGetTime();
|
||||||
|
|
||||||
if (paletteConvProgram && glActiveTexture && glUniform1i)
|
if (paletteConvProgram)
|
||||||
{
|
{
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user