-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
60 lines (48 loc) · 1.34 KB
/
main.cpp
File metadata and controls
60 lines (48 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <iostream>
#include <GLFW/glfw3.h>
#include <HelloWorldConfig.h>
#ifdef USE_ADDER
#include <adder.h>
#endif
int main( int argc, char *argv[] )
{
std::cout << "Hello World from Charles Smith." << std::endl;
#ifdef USE_ADDER
std::cout << "Testing out adder " << add( 72.3f, 73.8f ) << std::endl;
#else
std::cout << "USE_ADDER=OFF therefore the adder library was not used in the source code." << std::endl;
#endif
std::cout << "Program name : " << HelloWorld_NAME << std::endl;
std::cout << "Program Version : " << HelloWorld_VER << std::endl;
std::cout << "argv[0]: " << argv[0] << " Version: " << HelloWorld_VERSION_MAJOR
<< "." << HelloWorld_VERSION_MINOR
<< "." << HelloWorld_VERSION_PATCH << std::endl;
std::cout << "argc: " << argc << std::endl;
GLFWwindow *window;
if( !glfwInit() )
{
fprintf( stderr, "Failed to initialize GLFW\n" );
exit( EXIT_FAILURE );
}
window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL );
if( !window )
{
fprintf( stderr, "Failed to open GLFW window\n" );
glfwTerminate();
exit( EXIT_FAILURE );
}
// Main loop
while( !glfwWindowShouldClose( window ) )
{
// // Draw gears
// draw();
// // Update animation
// animate();
// Swap buffers
glfwSwapBuffers( window );
glfwPollEvents();
}
// Terminate GLFW
glfwTerminate();
return 0;
}