Skip to content

Commit

Permalink
Added glewInit for linux plattform
Browse files Browse the repository at this point in the history
  • Loading branch information
manolopm committed Jan 21, 2012
1 parent 758e85f commit e074f2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Core.cpp
Expand Up @@ -84,14 +84,14 @@ int Core::Initialize(std::string title_ = "Title" , int width_ = DefaultWidth, i
Logger::Instance()->OutputString("SDL_SetVideoMode succeeded");


#ifdef __WIN32__
#ifdef __NEEDSGLEW__
// GLEW
if (glewInit() != GLEW_OK) {
Logger::Instance()->OutputString("Error: glewInit()");
return -1;
}
Logger::Instance()->OutputString("glewInit succeeded");
#endif __WIN32__
#endif __NEEDSGLEW__

// オプションのテクスチャ
glGenTextures(1, &optionTexture);
Expand Down
10 changes: 9 additions & 1 deletion Core.h
Expand Up @@ -3,6 +3,14 @@

#include <SDL.h>

#ifdef __WIN32__
#define __NEEDSGLEW__
#endif __WIN32__

#ifdef __linux__
#define __NEEDSGLEW__
#endif __linux__

#ifdef __WIN32__
#include <windows.h>
#endif __WIN32__
Expand Down Expand Up @@ -87,4 +95,4 @@ class Core {

};

#endif
#endif

0 comments on commit e074f2b

Please sign in to comment.