Changeset 667
- Timestamp:
- Feb 18, 2011, 4:55:34 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/video.cpp
r666 r667 39 39 "\n" 40 40 "in vec3 in_Position;\n" 41 "in vec3 in_Color;\n"41 //"in vec3 in_Color;\n" 42 42 "in vec2 in_TexCoord;\n" 43 "out vec3 pass_Color;\n"43 //"out vec3 pass_Color;\n" 44 44 "uniform mat4 proj_matrix;\n" 45 45 "uniform mat4 view_matrix;\n" … … 51 51 " * vec4(in_Position, 1.0f);\n" 52 52 " gl_TexCoord[0] = vec4(in_TexCoord, 0.0, 0.0);\n" 53 " pass_Color = in_Color;\n"53 //" pass_Color = in_Color;\n" 54 54 "}\n"; 55 55 … … 58 58 "\n" 59 59 "uniform sampler2D in_Texture;\n" 60 "in vec3 pass_Color;\n"60 //"in vec3 pass_Color;\n" 61 61 "out vec4 out_Color;\n" 62 62 "\n" … … 132 132 view_matrix = mat4(1.0f); 133 133 134 #if !LOL_EXPERIMENTAL135 glMatrixMode(GL_PROJECTION);136 glLoadIdentity();137 glMultMatrixf(&proj_matrix[0][0]);138 139 /* Reset the model view matrix, just in case */140 glMatrixMode(GL_MODELVIEW);141 glLoadIdentity();142 glMultMatrixf(&view_matrix[0][0]);143 #endif144 }145 146 void Video::SetDepth(bool set)147 {148 if (set)149 glEnable(GL_DEPTH_TEST);150 else151 glDisable(GL_DEPTH_TEST);152 }153 154 void Video::Clear()155 {156 glViewport(0, 0, GetWidth(), GetHeight());157 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);158 159 134 #if LOL_EXPERIMENTAL 160 135 GLuint uni; … … 163 138 uni = stdshader->GetUniformLocation("view_matrix"); 164 139 glUniformMatrix4fv(uni, 1, GL_FALSE, &view_matrix[0][0]); 165 #endif 140 #else 141 glMatrixMode(GL_PROJECTION); 142 glLoadIdentity(); 143 glMultMatrixf(&proj_matrix[0][0]); 144 145 /* Reset the model view matrix, just in case */ 146 glMatrixMode(GL_MODELVIEW); 147 glLoadIdentity(); 148 glMultMatrixf(&view_matrix[0][0]); 149 #endif 150 } 151 152 void Video::SetDepth(bool set) 153 { 154 if (set) 155 glEnable(GL_DEPTH_TEST); 156 else 157 glDisable(GL_DEPTH_TEST); 158 } 159 160 void Video::Clear() 161 { 162 glViewport(0, 0, GetWidth(), GetHeight()); 163 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 166 164 167 165 SetFov(0.0f);
Note: See TracChangeset
for help on using the changeset viewer.