language: C++ 4.7.2 (gcc-4.7.2)
date: 423 days 19 hours ago
link:
visibility: public
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
MAIN.CPP
------------------------------------
 
 
 
 
 
//////////////////////////////
//Main Libary
/////////////////////////////
#define NO_SDL_GLEXT
#include <glew.h>
#include "SDL/SDL.H"
#include  "SDL/SDL_IMAGE.H"
#include "SDL/SDL_OPENGL.H"
#undef main
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <boost/iostreams/stream.hpp>
#include <libs/iostreams/example/container_device.hpp>
#include <boost/filesystem.hpp>
#include <boost/iostreams/categories.hpp>
#include <boost/algorithm/string.hpp>
#include <vector>
#include <fstream>
#include "GL/glu.h"
////////////////////////////
using namespace std;
///////////////////////////
//DEFINES
///////////////////////////
#define SCREEN_WIDTH  1240
#define SCREEN_HEIGHT 960
#define BPP 32
#define GL_GLEXT_PROTOTYPES
#define GetError( )\
        {\
            for ( GLenum Error = glGetError( ); ( GL_NO_ERROR != Error ); Error = glGetError( ) )\
            {\
                switch ( Error )\
                {\
                    case GL_INVALID_ENUM:      printf( "\n%s\n\n", "GL_INVALID_ENUM"      ); assert( 0 ); break;\
                    case GL_INVALID_VALUE:     printf( "\n%s\n\n", "GL_INVALID_VALUE"     ); assert( 0 ); break;\
                    case GL_INVALID_OPERATION: printf( "\n%s\n\n", "GL_INVALID_OPERATION" ); assert( 0 ); break;\
                    case GL_OUT_OF_MEMORY:     printf( "\n%s\n\n", "GL_OUT_OF_MEMORY"     ); assert( 0 ); break;\
                    default:                                                                              break;\
                }\
            }\
        }
 
///////////////////////////
 
 
////////////////////////////
//Other Header Files
///////////////////////////
#include "GraphicalUserInterface.h"
#include "SurfaceStorage.h"
  
//////////////////////////
            
 
 
            //Load Shader Function
            GLuint LoadProgram(const char * vertex_file_path, const char * Fragment_file_path){
            
            GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER);
            GLuint FragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
 
            //READ THE VERTEX SHADER CODE
            string VertexShaderCode;
            ifstream VertexShaderStream(vertex_file_path, std::ios::in);
            if(VertexShaderStream.is_open())
            {
                string Line = "";
                while(getline(VertexShaderStream, Line))
                    VertexShaderCode += "\n" + Line;
                VertexShaderStream.close();   
            }
            
 
            //READ THE FRAGMENT SHADER CODE
            string FragmentShaderCode;
            ifstream FragmentShaderStream(Fragment_file_path, std::ios::in);
            if(FragmentShaderStream.is_open())
            {
            
              string Line = "";
              while(getline(FragmentShaderStream, Line))
                  FragmentShaderCode += "\n" + Line;
              FragmentShaderStream.close();
            
            }
 
            GLint Result = GL_FALSE;
            int InfoLogLength;
 
            //Compile Vertex Shader
            printf("Compiling Shader : %s\n", vertex_file_path);
            char const * VertexSourcePointer = VertexShaderCode.c_str();
            glShaderSource(VertexShaderID,  1,  &VertexSourcePointer,  NULL);
            glCompileShader(VertexShaderID);
 
            //Check Vertex Shader
            glGetShaderiv(VertexShaderID, GL_COMPILE_STATUS,  &Result);
            glGetShaderiv(VertexShaderID, GL_INFO_LOG_LENGTH, &InfoLogLength);
            vector<char> VertexShaderErrorMessage(InfoLogLength);
            glGetShaderInfoLog(VertexShaderID, InfoLogLength, NULL, &VertexShaderErrorMessage[0]);
            fprintf(stdout, "%s\n",  &VertexShaderErrorMessage[0]);
 
 
            //Compile Fragment Shader
            printf("Compiling Shader : %s\n",  Fragment_file_path);
            char const * FragmentSourcePointer = FragmentShaderCode.c_str();
            glShaderSource(FragmentShaderID, 1, &FragmentSourcePointer, NULL);
            glCompileShader(FragmentShaderID);
 
            //Check Fragment Shader
            glGetShaderiv(FragmentShaderID, GL_COMPILE_STATUS, &Result);
            glGetShaderiv(FragmentShaderID, GL_INFO_LOG_LENGTH, &InfoLogLength);
            vector<char> FragmentShaderErrorMessage(InfoLogLength);
            glGetShaderInfoLog(FragmentShaderID, InfoLogLength, NULL, &FragmentShaderErrorMessage[0]);
            fprintf(stdout,  "%s\n",  &FragmentShaderErrorMessage[0]);
            
            fprintf(stdout,  "Linking Program\n");
            GLuint ProgramID = glCreateProgram();
 
 
            glBindAttribLocation(ProgramID, 3, "texture_coordinate" );
 
            //Link The Program
           
            glAttachShader(ProgramID, VertexShaderID);
            glAttachShader(ProgramID, FragmentShaderID);
            glLinkProgram(ProgramID);
 
            //Check The Program
            glGetProgramiv(ProgramID,  GL_LINK_STATUS, &Result);
            glGetProgramiv(ProgramID, GL_INFO_LOG_LENGTH, &InfoLogLength);
            vector<char> ProgramErrorMessage( max(InfoLogLength, int(1)) );
            fprintf(stdout,  "%s\n", &ProgramErrorMessage[0]);
            
            //Delete Shader
            glDeleteShader(VertexShaderID);
            glDeleteShader(FragmentShaderID);
           
            glUseProgram(ProgramID);
 
 
            glVertexAttribPointer(3, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(float), reinterpret_cast<GLvoid*>(3 * sizeof(float)));
 
            int samplerLocation = glGetUniformLocation(ProgramID, "texture");
 
         
            int texture_coordinate =  glGetUniformLocation(ProgramID, "texture_coordinate");
 
           
            int my_vec3_location =  glGetUniformLocation(ProgramID, "translations");
 
 
 
             //HOW TO DECLARE GLGETUNIFORMLOCATION  // -2  6 0 
             glUniform3f(my_vec3_location, -1.0, 0.5, 1);
 
 
             glUniform1i(samplerLocation, 0);
        
 
 
             return ProgramID;
   
                 
            }
     
           bool GUIToggle = true;
 
 
 
 
 
 
 
        int main(int argc , char *argv[])
        { 
 
          
          SDL_Init(SDL_INIT_EVERYTHING);
 
          
          //Screen Position
          SDL_putenv("SDL_VIDEO_CENTERED=center");
 
 
          //Screen Setup
          Screen = SDL_SetVideoMode(SCREEN_WIDTH,SCREEN_HEIGHT,BPP,SDL_OPENGL|SDL_DOUBLEBUF);
 
      
 
          //glew setup
          GLenum err = glewInit();
          glGetError();
          if (GLEW_OK != err)
            {
              /* Problem: glewInit failed, something is seriously wrong. */
               fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
 
            }
               fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
              
   
 
      /////////////////////////////
                  //OpenGL - Viewport Setup
                  ////////////////////////////
 
 
                  //Clear Color
                  glClearColor(0.0,0.0,0.0,0.0);
     
 
                  //Model View Matrix Setup
                  //glMatrixMode(GL_MODELVIEW);
      
                  //Reset Matrix
                  //glLoadIdentity();
     
 
 
                  //Projection Matrix Setup
                  //glMatrixMode(GL_PROJECTION);
      
 
                  //Projection Setup
                 // glOrtho(0, 1240,0,960,-1,1);
      
      //gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
 
                  // glOrtho( -SCREEN_WIDTH * 0.5f,SCREEN_WIDTH * 0.5f, -SCREEN_HEIGHT * 0.5f, SCREEN_HEIGHT * 0.5f,-1.0f, 1.0f ); 
 
 
                  glViewport(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
      GetError();
 
 
   
 
                  ////////////////////////////////////////////////////
 
          
          //On and Off Switch for Application
          bool done = false;
 
          //SDL Event
          SDL_Event event;
 
            //Top File Menu <Top ToolBar>
           SDL_Surface *TopFileMenuSurf = NULL;
 
           TopFileMenuSurf = IMG_Load("GUI/FileMenu.png");
 
 
 
           //Create and Compile our glsl program from the shaders
           GLuint programID = LoadProgram("graphicaluserinterface.v","graphicaluserinterface.f");
           
           GLuint texture;
 
           glGenTextures( 1, &texture );
           
            //this will identify our vertex buffer
            
             GLuint vertexbuffer;
           
 
 
             //generate a buffer
             glGenBuffers(1, &vertexbuffer);
             
 
             //Bind Texture to OpenGL
             glBindTexture(GL_TEXTURE_2D, texture);
 
 
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST);
          
            
             glTexImage2D( GL_TEXTURE_2D, 0,GL_RGB, TopFileMenuSurf->w,TopFileMenuSurf->h, 0,
              GL_RGBA, GL_UNSIGNED_BYTE, TopFileMenuSurf->pixels );
          
 
            glActiveTexture(GL_TEXTURE0);
 
  
 
      
  
      //////////////////
      //IMAGE LOADING
      /////////////////
 
         
             
 
 
          //Main While Loop
          while(!done)
          {
                 
           
 
             //Clear
             glClear(GL_COLOR_BUFFER_BIT);
          
       
             //Logic
             
 
 
              //Draw GUI
              if(GUIToggle == true)
              {
 
           
                    //Graphical User Interface Shader
             glUseProgram(programID);
 
               GUI();
              
 
             //Drawing GUI and Controls
           
              
              }
          
 
          while(SDL_PollEvent(&event))
            {
            switch(event.type)
               {
                
                 case SDL_QUIT:
                   return 0;
                   break;           
                  }
              
                   
                }
      
 
                     //Update
                     SDL_GL_SwapBuffers();  
 
 
          }
                    
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        
                
        }
 
 
GRAPHICAL USER INTERFACE.H
--------------------------------------
 
 
//////////////////////////////
//Main Libary
/////////////////////////////
#define NO_SDL_GLEXT
#include <glew.h>
#include "SDL/SDL.H"
#include  "SDL/SDL_IMAGE.H"
#include "SDL/SDL_OPENGL.H"
#undef main
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <boost/iostreams/stream.hpp>
#include <libs/iostreams/example/container_device.hpp>
#include <boost/filesystem.hpp>
#include <boost/iostreams/categories.hpp>
#include <boost/algorithm/string.hpp>
#include <vector>
#include <fstream>
#include "GL/glu.h"
////////////////////////////
using namespace std;
///////////////////////////
//DEFINES
///////////////////////////
#define SCREEN_WIDTH  1240
#define SCREEN_HEIGHT 960
#define BPP 32
#define GL_GLEXT_PROTOTYPES
#define GetError( )\
        {\
            for ( GLenum Error = glGetError( ); ( GL_NO_ERROR != Error ); Error = glGetError( ) )\
            {\
                switch ( Error )\
                {\
                    case GL_INVALID_ENUM:      printf( "\n%s\n\n", "GL_INVALID_ENUM"      ); assert( 0 ); break;\
                    case GL_INVALID_VALUE:     printf( "\n%s\n\n", "GL_INVALID_VALUE"     ); assert( 0 ); break;\
                    case GL_INVALID_OPERATION: printf( "\n%s\n\n", "GL_INVALID_OPERATION" ); assert( 0 ); break;\
                    case GL_OUT_OF_MEMORY:     printf( "\n%s\n\n", "GL_OUT_OF_MEMORY"     ); assert( 0 ); break;\
                    default:                                                                              break;\
                }\
            }\
        }
 
///////////////////////////
 
 
////////////////////////////
//Other Header Files
///////////////////////////
 
 
#ifndef SURFACESTORAGE_H
#define SURFACESTORAGE_H
  
#endif  
//////////////////////////
 
//////////////////////////////////////////////
//ONLY FOR CONTROLS AND DRAWING GUI GRAPHICS
/////////////////////////////////////////////
 
        void GUI(void)
          {
                                     
 
 
            //this will identify our vertex buffer
            
             GLuint vertexbuffer;
           
 
 
             //generate a buffer
             glGenBuffers(1, &vertexbuffer);
         
                    // X    //y   //z   //u   //v
GLfloat vVerts[] = {  0.5f, 0.5f, 0.0f, 1.0f, 1.0f , 
                      0.0f, 0.5f, 0.0f, 0.0f, 1.0f, 
                      0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 
                      0.5f, 0.0f, 0.0f, 1.0f, 0.0f};
                                       //tex x and y 
            
 
            //to mix texture with color for shading
            //glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
 
          
             //this binds the buffer the array buffer with your buffer
            glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
           
            
            //Give are vertices to opengl
            glBufferData(GL_ARRAY_BUFFER,  sizeof(vVerts), vVerts, GL_STATIC_DRAW);
          
 
            //1st attribute buffer : vertices
            glEnableVertexAttribArray(0);
         
           //glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
           
          
            glVertexAttribPointer(0, 3,GL_FLOAT,GL_FALSE,  5 * sizeof(float),0);
            
       
         
            glDrawArrays(GL_QUADS, 0,  4);
 
    
          
 
            glDisableVertexAttribArray(0);
              //FOR DRAWING VERTICES ONTO THE SCREEN ONLY
            //GLfloat tex_u; GLfloat tex_v;
 
             //Rather then GlVertex you make 3 vectors in an glfloat
 
            
   
          }
 
     
 
FRAGMENT SHADER
----------------------
#version 150
//orginally 130
//orginally 110
 
 
//Texture Uniform Sampler 2D Container
uniform sampler2D texture;
 
in vec2 texture_coord;
 
 
 
varying vec3 texture_coordinate;
 
//Main Entry Point
void main(void){
 
 
     
  
 
   //To Tell GLSL The Texture and Texture Coords  texture cords is the position
   gl_FragColor = texture(texture, texture_coord);
   
   //vec4(1.0, 0.0, 0.0, 1.0); 
   //gl_FragColor = vec4(texture_coordinate.xy, 0.0, 1.0);
   
  
    
}
 
 
VERTEX SHADER
---------------
 
#version 150
 
//Always use a attribute vec4 for position variable
in vec4 position;
 
 
//Matrix 3 x 3 row
//mat4 projection;
 
 
//Texture Cordinates 2 element vector of varying type
 
//attribute vec2 texture_coordinate;
out vec2 texture_coordinate; 
 
out vec2 texture_coord;
//Translations 3 element vector uniform
uniform vec3 translations;
 
 
      //Projection Matrix
        //mat4 projection = mat4(
       // vec4(1.0, 0.0, 0.0, 0.0),
       // vec4(0.0, 1.0, 0.0, 0.0),
       // vec4(0.0, 0.0, 1.0, 0.0), 
       // vec4(0.0, 0.0, 0.0, 1.0)); 
 
 
//Main Entry Point
void main()
{
 
 
      //Passing The Texture Coordinate of Texture Unit 0 To The Fragment Shader
      texture_coord = (texture_coordinate);
 
 
  
 
  // To Put The Vertex in View? //ORGINALLY 8.0
 gl_Position = vec4(position.xyz + translations.xyz, 1.0);
 
 
  
}
 
 
 
prog.cpp:12:18: error: glew.h: No such file or directory
prog.cpp:13:21: error: SDL/SDL.H: No such file or directory
prog.cpp:14:28: error: SDL/SDL_IMAGE.H: No such file or directory
prog.cpp:15:28: error: SDL/SDL_OPENGL.H: No such file or directory
prog.cpp:22:55: error: libs/iostreams/example/container_device.hpp: No such file or directory
prog.cpp:28:20: error: GL/glu.h: No such file or directory
prog.cpp:59:36: error: GraphicalUserInterface.h: No such file or directory
prog.cpp:60:28: error: SurfaceStorage.h: No such file or directory
prog.cpp:496:2: error: invalid preprocessing directive #version
prog.cpp:531:2: error: invalid preprocessing directive #version
prog.cpp:1: error: expected constructor, destructor, or type conversion before ‘.’ token
prog.cpp:67: error: ‘GLuint’ does not name a type
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:189: error: ‘SDL_INIT_EVERYTHING’ was not declared in this scope
prog.cpp:189: error: ‘SDL_Init’ was not declared in this scope
prog.cpp:193: error: ‘SDL_putenv’ was not declared in this scope
prog.cpp:197: error: ‘Screen’ was not declared in this scope
prog.cpp:197: error: ‘SDL_OPENGL’ was not declared in this scope
prog.cpp:197: error: ‘SDL_DOUBLEBUF’ was not declared in this scope
prog.cpp:197: error: ‘SDL_SetVideoMode’ was not declared in this scope
prog.cpp:202: error: ‘GLenum’ was not declared in this scope
prog.cpp:202: error: expected `;' before ‘err’
prog.cpp:203: error: ‘glGetError’ was not declared in this scope
prog.cpp:204: error: ‘GLEW_OK’ was not declared in this scope
prog.cpp:204: error: ‘err’ was not declared in this scope
prog.cpp:207: error: ‘glewGetErrorString’ was not declared in this scope
prog.cpp:210: error: ‘GLEW_VERSION’ was not declared in this scope
prog.cpp:210: error: ‘glewGetString’ was not declared in this scope
prog.cpp:220: error: ‘glClearColor’ was not declared in this scope
prog.cpp:243: error: ‘glViewport’ was not declared in this scope
prog.cpp:244: error: expected `;' before ‘Error’
prog.cpp:244: error: ‘GL_NO_ERROR’ was not declared in this scope
prog.cpp:244: error: ‘Error’ was not declared in this scope
prog.cpp:244: error: ‘GL_INVALID_ENUM’ was not declared in this scope
prog.cpp:244: error: ‘GL_INVALID_VALUE’ was not declared in this scope
prog.cpp:244: error: ‘GL_INVALID_OPERATION’ was not declared in this scope
prog.cpp:244: error: ‘GL_OUT_OF_MEMORY’ was not declared in this scope
prog.cpp:256: error: ‘SDL_Event’ was not declared in this scope
prog.cpp:256: error: expected `;' before ‘event’
prog.cpp:259: error: ‘SDL_Surface’ was not declared in this scope
prog.cpp:259: error: ‘TopFileMenuSurf’ was not declared in this scope
prog.cpp:261: error: ‘IMG_Load’ was not declared in this scope
prog.cpp:266: error: ‘GLuint’ was not declared in this scope
prog.cpp:266: error: expected `;' before ‘programID’
prog.cpp:268: error: expected `;' before ‘texture’
prog.cpp:270: error: ‘texture’ was not declared in this scope
prog.cpp:270: error: ‘glGenTextures’ was not declared in this scope
prog.cpp:274: error: expected `;' before ‘vertexbuffer’
prog.cpp:279: error: ‘vertexbuffer’ was not declared in this scope
prog.cpp:279: error: ‘glGenBuffers’ was not declared in this scope
prog.cpp:283: error: ‘GL_TEXTURE_2D’ was not declared in this scope
prog.cpp:283: error: ‘glBindTexture’ was not declared in this scope
prog.cpp:286: error: ‘GL_TEXTURE_MIN_FILTER’ was not declared in this scope
prog.cpp:286: error: ‘GL_NEAREST’ was not declared in this scope
prog.cpp:286: error: ‘glTexParameteri’ was not declared in this scope
prog.cpp:287: error: ‘GL_TEXTURE_MAG_FILTER’ was not declared in this scope
prog.cpp:290: error: ‘GL_RGB’ was not declared in this scope
prog.cpp:291: error: ‘GL_RGBA’ was not declared in this scope
prog.cpp:291: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
prog.cpp:291: error: ‘glTexImage2D’ was not declared in this scope
prog.cpp:294: error: ‘GL_TEXTURE0’ was not declared in this scope
prog.cpp:294: error: ‘glActiveTexture’ was not declared in this scope
prog.cpp:315: error: ‘GL_COLOR_BUFFER_BIT’ was not declared in this scope
prog.cpp:315: error: ‘glClear’ was not declared in this scope
prog.cpp:328: error: ‘programID’ was not declared in this scope
prog.cpp:328: error: ‘glUseProgram’ was not declared in this scope
prog.cpp:330: error: ‘GUI’ was not declared in this scope
prog.cpp:339: error: ‘event’ was not declared in this scope
prog.cpp:339: error: ‘SDL_PollEvent’ was not declared in this scope
prog.cpp:344: error: ‘SDL_QUIT’ was not declared in this scope
prog.cpp:354: error: ‘SDL_GL_SwapBuffers’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:366: error: ‘GRAPHICAL’ does not name a type
prog.cpp: In function ‘void GUI()’:
prog.cpp:440: error: ‘GLuint’ was not declared in this scope
prog.cpp:440: error: expected `;' before ‘vertexbuffer’
prog.cpp:445: error: ‘vertexbuffer’ was not declared in this scope
prog.cpp:445: error: ‘glGenBuffers’ was not declared in this scope
prog.cpp:448: error: ‘GLfloat’ was not declared in this scope
prog.cpp:448: error: expected `;' before ‘vVerts’
prog.cpp:460: error: ‘GL_ARRAY_BUFFER’ was not declared in this scope
prog.cpp:460: error: ‘glBindBuffer’ was not declared in this scope
prog.cpp:464: error: ‘vVerts’ was not declared in this scope
prog.cpp:464: error: ‘GL_STATIC_DRAW’ was not declared in this scope
prog.cpp:464: error: ‘glBufferData’ was not declared in this scope
prog.cpp:468: error: ‘glEnableVertexAttribArray’ was not declared in this scope
prog.cpp:473: error: ‘GL_FLOAT’ was not declared in this scope
prog.cpp:473: error: ‘GL_FALSE’ was not declared in this scope
prog.cpp:473: error: ‘glVertexAttribPointer’ was not declared in this scope
prog.cpp:477: error: ‘GL_QUADS’ was not declared in this scope
prog.cpp:477: error: ‘glDrawArrays’ was not declared in this scope
prog.cpp:482: error: ‘glDisableVertexAttribArray’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:494: error: ‘FRAGMENT’ does not name a type
prog.cpp:504: error: ‘in’ does not name a type
prog.cpp:508: error: ‘varying’ does not name a type
prog.cpp:511: error: ‘::main’ must return ‘int’
prog.cpp: In function ‘int main()’:
prog.cpp:511: error: declaration of C function ‘int main()’ conflicts with
prog.cpp:185: error: previous declaration ‘int main(int, char**)’ here
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:518: error: ‘gl_FragColor’ was not declared in this scope
prog.cpp:518: error: ‘texture’ was not declared in this scope
prog.cpp:518: error: ‘texture_coord’ was not declared in this scope
prog.cpp:518: error: ‘texture’ was not declared in this scope
prog.cpp:518: error: declaration of ‘<typeprefixerror>texture’
prog.cpp:518: error: conflicts with previous declaration ‘<typeprefixerror>texture’
prog.cpp: At global scope:
prog.cpp:528: error: ‘VERTEX’ does not name a type
prog.cpp:544: error: ‘out’ does not name a type
prog.cpp:546: error: ‘out’ does not name a type
prog.cpp:548: error: ‘uniform’ does not name a type
prog.cpp:560: error: ‘::main’ must return ‘int’
prog.cpp: In function ‘int main()’:
prog.cpp:560: error: redefinition of ‘int main()’
prog.cpp:511: error: ‘int main()’ previously defined here
prog.cpp:565: error: ‘texture_coord’ was not declared in this scope
prog.cpp:565: error: ‘texture_coordinate’ was not declared in this scope
prog.cpp:571: error: ‘gl_Position’ was not declared in this scope
prog.cpp:571: error: ‘position’ was not declared in this scope
prog.cpp:571: error: ‘translations’ was not declared in this scope
prog.cpp:571: error: ‘vec4’ was not declared in this scope