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