1 // License information.
2 // The Software "SAF BENCH" was written by Patrik.A, also known as Nitton Attiofyra
3 // on YouTube. (https://www.youtube.com/@NittonAttiofyra)
5 // The software is released in to the Public Domain and comes with no warranty and is used
8 #include <stdlib.h> // VS 2005 wont compile it if its noth placed here, need to investigate
21 #include "bmp_alpha.h"
24 #define for if(0);else for // C2374 VC6++ on Alpha bug
27 #pragma warning( disable : 4305 )
28 #define for if(0);else for // VC6++ on Alpha bug
31 int menu = 1; // what menu to render
32 GLfloat check_pos; // position of check marker in settings menu
33 GLfloat res_dial_w; // rotate the width resolution dial
34 GLfloat res_dial_h; // rotate the height resolution dial
36 static GLuint texture_main_menu, texture_settings_menu, texture_check; // Textures
42 texture_main_menu = LoadTexture(":textures:menu:main.bmp", 256, 256);
43 texture_settings_menu = LoadTexture(":textures:menu:settings.bmp", 256, 256);
44 texture_check = LoadTexture(":textures:menu:check.bmp", 16, 16);
46 texture_main_menu = LoadTexture("textures/menu/main.bmp", 256, 256);
47 texture_settings_menu = LoadTexture("textures/menu/settings.bmp", 256, 256);
48 texture_check = LoadTexture("textures/menu/check.bmp", 16, 16);
52 // code for drwaing menus
55 // draw main menu or settings menu
59 glBindTexture( GL_TEXTURE_2D, texture_main_menu );
60 glEnable(GL_TEXTURE_2D);
64 glTexCoord2f(.005,0);glVertex3f(-32, -24, -41.5);
65 glTexCoord2f(.995,0); glVertex3f(32, -24, -41.5);
66 glTexCoord2f(.995,1);glVertex3f(32, 24, -41.5);
67 glTexCoord2f(.005,1);glVertex3f(-32, 24, -41.5);
71 glDisable(GL_TEXTURE_2D);
73 // draw width resolution dial indicator
75 glTranslatef (6, -17, 0); // position the dial indicator
76 glRotatef(res_dial_w, 0, 0, -1); // rotate the dial indicator
80 glVertex3f(-0.5, 0, -41.0);
81 glVertex3f(-0.1, -3.5, -41.0);
82 glVertex3f(0.1, -3.5, -41.0);
83 glVertex3f(0.5, 0, -41.0);
87 // draw height resolution dial indicator
89 glTranslatef (6, -17, 0); // position the dial indicator
90 glRotatef(res_dial_h, 0, 0, -1); // rotate the dial indicator
93 glColor3f(0.8, 0.8, 0.8);
94 glVertex3f(-1, 0, -40.5);
95 glVertex3f(0, -3, -40.5);
96 glVertex3f(1, 0, -40.5);
97 glVertex3f(0, 1, -40.5);
103 // draws settings menu
104 glBindTexture( GL_TEXTURE_2D, texture_settings_menu );
105 glEnable(GL_TEXTURE_2D);
109 glTexCoord2f(.005,0);glVertex3f(-32, -24, -41.5);
110 glTexCoord2f(.995,0);glVertex3f(32, -24, -41.5);
111 glTexCoord2f(.995,1);glVertex3f(32, 24, -41.5);
112 glTexCoord2f(.005,1);glVertex3f(-32, 24, -41.5);
116 glDisable(GL_TEXTURE_2D);
118 // draw marker in check box in settins menu
120 glBindTexture( GL_TEXTURE_2D, texture_check );
121 //else if (left_mouse_button == 1 && mouse_x_pos >= 15 && mouse_x_pos <= 47 && mouse_y_pos >= 39 && mouse_y_pos <= 62 && mouse_lock == 0)
122 glEnable(GL_TEXTURE_2D);
126 glTexCoord2f(.005,0);glVertex3f(-28.8, 16.7 - check_pos, -41);
127 glTexCoord2f(.995,0);glVertex3f(-26.8,16.7 - check_pos, -41);
128 glTexCoord2f(.995,1);glVertex3f(-26.8, 18.7 - check_pos, -41);
129 glTexCoord2f(.005,1);glVertex3f(-28.8, 18.7 - check_pos, -41);
133 glDisable(GL_TEXTURE_2D);