diff options
| author | Bryan Hoyle <starfoxprime@gmail.com> | 2012-08-12 18:29:27 (GMT) |
|---|---|---|
| committer | Bryan Hoyle <starfoxprime@gmail.com> | 2012-08-12 18:29:27 (GMT) |
| commit | 530e093d8b25f8ac9be48507319f1353f4695679 (patch) | |
| tree | f7f7541020c9fec0955e026e39bff0e7e93714af /src | |
| parent | 859aa0cf14d96acfde8ebe9b5d5c452ec6d3793b (diff) | |
| download | powder-530e093d8b25f8ac9be48507319f1353f4695679.zip powder-530e093d8b25f8ac9be48507319f1353f4695679.tar.gz | |
now opengl and opengl renderer run and compile, but renderer has a segfault, will fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/PowderToySDL.cpp | 16 | ||||
| -rw-r--r-- | src/graphics/OpenGLGraphics.cpp | 5 | ||||
| -rw-r--r-- | src/graphics/Renderer.h | 1 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 48c6292..1085561 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -199,14 +199,6 @@ int SDLOpen() //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); atexit(SDL_Quit); -#if defined(OGLI) - int status = glewInit(); - if(status != GLEW_OK) - { - fprintf(stderr, "Initializing Glew: %d\n", status); - exit(-1); - } -#endif return 0; } @@ -352,6 +344,14 @@ int main(int argc, char * argv[]) SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); //glScaled(2.0f, 2.0f, 1.0f); #endif +#if defined(OGLI) + int status = glewInit(); + if(status != GLEW_OK) + { + fprintf(stderr, "Initializing Glew: %d\n", status); + exit(-1); + } +#endif ui::Engine::Ref().g = new Graphics(); ui::Engine::Ref().Scale = scale; inputScale = 1.0f/float(scale); diff --git a/src/graphics/OpenGLGraphics.cpp b/src/graphics/OpenGLGraphics.cpp index 34935e7..4f1d5d4 100644 --- a/src/graphics/OpenGLGraphics.cpp +++ b/src/graphics/OpenGLGraphics.cpp @@ -7,13 +7,12 @@ #ifdef OGLI static pthread_mutex_t gMutex = PTHREAD_MUTEX_INITIALIZER; - +//static pthread_mutex_t TMPMUT = PTHREAD_MUTEX_INITIALIZER; Graphics::Graphics(): sdl_scale(1) { -// if(gMutex == PTHREAD_MUTEX_INITIALIZER) +// if(gMutex == TMPMUT) // pthread_mutex_init (&gMutex, NULL); -printf("PTHREAD_MUTEX_INITIALIZER\n"); Reset(); glEnable(GL_BLEND); diff --git a/src/graphics/Renderer.h b/src/graphics/Renderer.h index 606dbc8..c395a91 100644 --- a/src/graphics/Renderer.h +++ b/src/graphics/Renderer.h @@ -85,6 +85,7 @@ public: void checkShader(GLuint shader, char * shname); void checkProgram(GLuint program, char * progname); void loadShaders(); + GLuint vidBuf,textTexture; #endif pixel * vid; pixel * persistentVid; |
