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
19 #include "bmp_alpha.h"
22 static GLuint texture_ground2_1,texture_ground2_2,texture_ground2_3,texture_ground2_4;
23 static GLuint texture_ground3_1,texture_ground3_2,texture_ground3_3,texture_ground3_4;
24 int draw_ground2 = 1; // draw ground2 or ground3
27 void textures_ground2()
30 texture_ground2_1 = LoadTexture(":textures:ground2:ground2_1.bmp" , 256, 256);
31 texture_ground2_2 = LoadTexture(":textures:ground2:ground2_2.bmp" , 256, 256);
32 texture_ground2_3 = LoadTexture(":textures:ground2:ground2_3.bmp" , 256, 256);
33 texture_ground2_4 = LoadTexture(":textures:ground2:ground2_4.bmp" , 256, 256);
34 texture_ground3_1 = LoadTexture(":textures:ground3:ground3_1.bmp" , 256, 256);
35 texture_ground3_2 = LoadTexture(":textures:ground3:ground3_2.bmp" , 256, 256);
36 texture_ground3_3 = LoadTexture(":textures:ground3:ground3_3.bmp" , 256, 256);
37 texture_ground3_4 = LoadTexture(":textures:ground3:ground3_4.bmp" , 256, 256);
39 texture_ground2_1 = LoadTexture("textures/ground2/ground2_1.bmp" , 256, 256);
40 texture_ground2_2 = LoadTexture("textures/ground2/ground2_2.bmp" , 256, 256);
41 texture_ground2_3 = LoadTexture("textures/ground2/ground2_3.bmp" , 256, 256);
42 texture_ground2_4 = LoadTexture("textures/ground2/ground2_4.bmp" , 256, 256);
43 texture_ground3_1 = LoadTexture("textures/ground3/ground3_1.bmp" , 256, 256);
44 texture_ground3_2 = LoadTexture("textures/ground3/ground3_2.bmp" , 256, 256);
45 texture_ground3_3 = LoadTexture("textures/ground3/ground3_3.bmp" , 256, 256);
46 texture_ground3_4 = LoadTexture("textures/ground3/ground3_4.bmp" , 256, 256);
56 // Enable culling. Remove one side of the polygons, back or front.
57 glEnable(GL_CULL_FACE);
60 if ( draw_ground2 == 1 )
63 glBindTexture( GL_TEXTURE_2D, texture_ground2_1 );
64 glEnable(GL_TEXTURE_2D);
68 glTexCoord2f(.002,0);glVertex3f(0, 0, 700);
69 glTexCoord2f(.998,0);glVertex3f(0, 0, 0);
70 glTexCoord2f(.998,1);glVertex3f(-700, 0, 0);
71 glTexCoord2f(.002,1);glVertex3f(-700, 0, 700);
75 glBindTexture( GL_TEXTURE_2D, texture_ground2_2 );
79 glTexCoord2f(.002,0);glVertex3f(0, 0, 0);
80 glTexCoord2f(.998,0);glVertex3f(0, 0, -700);
81 glTexCoord2f(.998,1);glVertex3f(-700, 0, -700);
82 glTexCoord2f(.002,1);glVertex3f(-700, 0, 0);
86 glBindTexture( GL_TEXTURE_2D, texture_ground2_3 );
90 glTexCoord2f(.002,0);glVertex3f(700, 0, 700);
91 glTexCoord2f(.998,0);glVertex3f(700, 0, 0);
92 glTexCoord2f(.998,1);glVertex3f(0, 0, 0);
93 glTexCoord2f(.002,1);glVertex3f(0, 0, 700);
97 glBindTexture( GL_TEXTURE_2D, texture_ground2_4 );
101 glTexCoord2f(.002,0);glVertex3f(700, 0, 0);
102 glTexCoord2f(.998,0);glVertex3f(700, 0, -700);
103 glTexCoord2f(.998,1);glVertex3f(0, 0, -700);
104 glTexCoord2f(.002,1);glVertex3f(0, 0, 0);
109 else if ( draw_ground2 == 0 )
112 glBindTexture( GL_TEXTURE_2D, texture_ground3_1 );
113 glEnable(GL_TEXTURE_2D);
117 glTexCoord2f(.002,0);glVertex3f(0, 0, 2100);
118 glTexCoord2f(.998,0);glVertex3f(0, 0, 0);
119 glTexCoord2f(.998,1);glVertex3f(-2100, 0, 0);
120 glTexCoord2f(.002,1);glVertex3f(-2100, 0, 2100);
124 glBindTexture( GL_TEXTURE_2D, texture_ground3_2 );
128 glTexCoord2f(.002,0);glVertex3f(0, 0, 0);
129 glTexCoord2f(.998,0);glVertex3f(0, 0, -2100);
130 glTexCoord2f(.998,1);glVertex3f(-2100, 0, -2100);
131 glTexCoord2f(.002,1);glVertex3f(-2100, 0, 0);
135 glBindTexture( GL_TEXTURE_2D, texture_ground3_3 );
136 glEnable(GL_TEXTURE_2D);
140 glTexCoord2f(.002,0);glVertex3f(2100, 0, 2100);
141 glTexCoord2f(.998,0);glVertex3f(2100, 0, 0);
142 glTexCoord2f(.998,1);glVertex3f(00, 0, 0);
143 glTexCoord2f(.002,1);glVertex3f(0, 0, 2100);
147 glBindTexture( GL_TEXTURE_2D, texture_ground3_4 );
148 glEnable(GL_TEXTURE_2D);
152 glTexCoord2f(.002,0);glVertex3f(2100, 0, 0);
153 glTexCoord2f(.998,0);glVertex3f(2100, 0, -2100);
154 glTexCoord2f(.998,1);glVertex3f(0, 0, -2100);
155 glTexCoord2f(.002,1);glVertex3f(0, 0, 0);
160 glDisable(GL_TEXTURE_2D);
163 glDisable(GL_CULL_FACE);
166 glDisable (GL_BLEND);