language: C++ 4.7.2 (gcc-4.7.2)
date: 427 days 4 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
 
FRAGMENT SHADER
------------------------
 
in vec2 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;
in 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:27:2: error: invalid preprocessing directive #version
prog.cpp:2: error: ‘FRAGMENT’ does not name a type
prog.cpp:8: error: ‘::main’ must return ‘int’
prog.cpp: In function ‘int main()’:
prog.cpp:15: error: ‘gl_FragColor’ was not declared in this scope
prog.cpp:15: error: ‘texture’ was not declared in this scope
prog.cpp:15: error: ‘texture_coord’ was not declared in this scope
prog.cpp:15: error: ‘texture’ was not declared in this scope
prog.cpp:15: error: declaration of ‘<typeprefixerror>texture’
prog.cpp:15: error: conflicts with previous declaration ‘<typeprefixerror>texture’
prog.cpp: At global scope:
prog.cpp:25: error: ‘VERTEX’ does not name a type
prog.cpp:40: error: ‘in’ does not name a type
prog.cpp:42: error: ‘out’ does not name a type
prog.cpp:44: error: ‘uniform’ does not name a type
prog.cpp:56: error: ‘::main’ must return ‘int’
prog.cpp: In function ‘int main()’:
prog.cpp:56: error: redefinition of ‘int main()’
prog.cpp:8: error: ‘int main()’ previously defined here
prog.cpp:61: error: ‘texture_coord’ was not declared in this scope
prog.cpp:61: error: ‘texture_coordinate’ was not declared in this scope
prog.cpp:67: error: ‘gl_Position’ was not declared in this scope
prog.cpp:67: error: ‘position’ was not declared in this scope
prog.cpp:67: error: ‘translations’ was not declared in this scope
prog.cpp:67: error: ‘vec4’ was not declared in this scope