Windows Support
This commit is contained in:
21
src/main.cpp
21
src/main.cpp
@@ -51,7 +51,13 @@
|
||||
|
||||
|
||||
// Libraries
|
||||
#include <GLUT/glut.h>
|
||||
#if defined(use_freeglut)
|
||||
# include <glad/glad.h>
|
||||
# define FREEGLUT_STATIC
|
||||
# include <gl/freeglut.h>
|
||||
#else
|
||||
# include <GLUT/glut.h>
|
||||
#endif
|
||||
#include <miniaudio.h>
|
||||
|
||||
// STD
|
||||
@@ -96,6 +102,9 @@ int lastWinW = 0, lastWinH = 0;
|
||||
*/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
std:;cout << "Starting";
|
||||
fflush(stdout);
|
||||
|
||||
int winW = 1280;
|
||||
int winH = 720;
|
||||
|
||||
@@ -108,6 +117,11 @@ int main(int argc, char **argv)
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutCreateWindow("Transform Example");
|
||||
|
||||
// This line only needs to run when glad is in use
|
||||
#if defined(use_freeglut)
|
||||
if (!gladLoadGL()) {}
|
||||
#endif
|
||||
|
||||
// Clear screen
|
||||
glClearColor(0.0, 0.0, 0.0, 1.0); // clear the window screen
|
||||
|
||||
@@ -137,10 +151,13 @@ int main(int argc, char **argv)
|
||||
// (This call will call the GlutLoopTimer() function immediately)
|
||||
glutTimerFunc(0, GlutLoopTimer, 0);
|
||||
|
||||
std:;cout << "Started";
|
||||
fflush(stdout);
|
||||
// Start the Glut Loop (Calls the funtions above repeatedly)
|
||||
glutMainLoop();
|
||||
|
||||
|
||||
std:;cout << "exited";
|
||||
fflush(stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user