LIBS = -lGL -lGLEW -lSDL2main -lSDL2 -lfreetype -lSDL2_image -lSDL2_mixer\r
\r
+WIN_LIBS = -lopengl32 -lglew32 -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype\r
+\r
FLAGS = -m32 -std=c++11 -Iinclude -Iinclude/freetype2\r
\r
all:\r
@echo " CXX main.cpp"\r
@g++ $(FLAGS) -o main main.cpp out/*.o $(LIBS)\r
\r
+win32:\r
+ @g++ $(FLAGS) -o main main.cpp src/*.cpp $(WIN_LIBS)\r
+ \r
clean:\r
@echo " RM main"\r
@-rm -f main\r
* of milliseconds that have passed sine the epoch.
*
*/
+
+#ifdef __WIN32__
+#define millis() SDL_GetTicks()
+#else
unsigned int millis(void){
std::chrono::system_clock::time_point now=std::chrono::system_clock::now();
return std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count();
}
+#endif
typedef enum {
SUNNY = 0,
// Run SDL_Quit when main returns
atexit(SDL_Quit);
- /*Untitled
+ /*
* (Attempt to) Initialize SDL_image libraries with IMG_INIT_PNG so that we can load PNG
* textures for the entities and stuff.
- * Untitled
+ *
*/
if(!(IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG)){
*/
GLenum err;
+#ifndef __WIN32__
glewExperimental = GL_TRUE;
+#endif
if((err=glewInit()) != GLEW_OK){
std::cout << "GLEW was not able to initialize! Error: " << glewGetErrorString(err) << std::endl;
return -1;