diff --git a/sources/main.cpp b/sources/main.cpp index 4f9e78c..4af9c6e 100755 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -14,8 +14,12 @@ #include // Only required under Windows :-D #endif +#ifndef UNIX #include // This file import the SDL inteface -//#include // This file import the SDL inteface +#else +#include // This file import the SDL inteface +#endif + #include // This file import the OpenGL interface #include // This file offers some OpenGL-related utilities @@ -30,18 +34,18 @@ #include -//#ifndef UNIX +#ifndef UNIX ///////////// // #PRAGMA // ///////////// // Visual Studio specific: you can import libraries directly by // specifing them through a #pragma. On other compilters/platforms add // the required .lib to the makefile or project proprieties -//#pragma comment(lib, "opengl32.lib") -//#pragma comment(lib, "glu32.lib") -//#pragma comment(lib, "sdl.lib") -//#pragma comment(lib, "sdlmain.lib") -//#endif +#pragma comment(lib, "opengl32.lib") +#pragma comment(lib, "glu32.lib") +#pragma comment(lib, "sdl.lib") +#pragma comment(lib, "sdlmain.lib") +#endif #include "vec.h" #include "color.h" @@ -65,6 +69,11 @@ #define DD() do { printf("DD:%d\n", debugct); debugct++;} while(0); +#ifndef UNIX +#define mysleep(x) do {Sleep(x/100);} while (0); +#else +#define mysleep(x) do {usleep(x);} while (0); +#endif /////////////////////////////////////////////////////////////////////////// // GLOBAL VARS @@ -354,11 +363,11 @@ glRotatef(deltay, 0.0f, 1.0f, 0.0f); // Rotation around the Y axis glRotatef(deltaz, 1.0f, 0.0f, 0.0f); - //cube->draw(); - //cube->rotate(Vec(0.0f, 0.01f, 0.01f)); + cube->draw(); + cube->rotate(Vec(0.0f, 0.01f, 0.01f)); - myModel->draw(); + //myModel->draw(); light0.draw(); light0.trace(); @@ -481,7 +490,7 @@ //////////////// // Swap buffers: - //TODO: usleep(2000); // Just don't kill computer resources ;) + mysleep(2000); // Just don't kill computer resources ;) SDL_GL_SwapBuffers(); // Plain stupid log, just to show values: @@ -507,17 +516,6 @@ deltacolor = 0.0f; } } - - - - //////////////// - // Swap buffers: - //TODO usleep(2000); // Just don't kill computer resources ;) - SDL_GL_SwapBuffers(); - - // Plain stupid log, just to show values: - //printf("X: %d, Y: %d, but1: %d, but2: %d\n", - // MouseX, MouseY, MouseButtonLeft, MouseButtonRight); } // Ok, release everything and byebye: