Changeset 745 for trunk/src/video.cpp
 Timestamp:
 Mar 19, 2011, 12:52:14 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/video.cpp
r742 r745 30 30 #endif 31 31 32 #if defined HAVE_GL_2X  defined HAVE_GLES_2X33 32 Shader *stdshader; 34 #endif35 33 mat4 proj_matrix, view_matrix, model_matrix; 36 34 37 #if defined HAVE_GL_2X  defined HAVE_GLES_2X38 35 static char const *vertexshader = 39 #if !defined HAVE_GLES_2X36 #if defined HAVE_GL_2X 40 37 "#version 130\n" 41 38 #endif … … 88 85 " vec4 col = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n" 89 86 #endif 90 #if 187 #if 0 91 88 " float mul = 2.0;\n" 92 " float dx1 = mod(gl_FragCoord.x, 2.0);\n" 93 " float dy1 = mod(gl_FragCoord.y, 2.0);\n" 94 " float t1 = mod(3.0 * dx1 + 2.0 * dy1, 4.0);\n" 89 " vec2 d1 = mod(vec2(gl_FragCoord), vec2(2.0, 2.0));\n" 90 " float t1 = mod(3.0 * d1.x + 2.0 * d1.y, 4.0);\n" 95 91 " float dx2 = mod(floor(gl_FragCoord.x * 0.5), 2.0);\n" 96 92 " float dy2 = mod(floor(gl_FragCoord.y * 0.5), 2.0);\n" … … 112 108 " gl_FragColor = col;\n" 113 109 "}\n"; 114 #endif115 110 116 111 /* … … 130 125 glClearDepthf(1.0); 131 126 132 #if defined HAVE_GL_2X  defined HAVE_GLES_1X127 #if defined HAVE_GL_2X 133 128 glShadeModel(GL_SMOOTH); 134 #endif135 #if defined HAVE_GL_2X  defined HAVE_GLES_1X136 129 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); 137 130 #endif 138 131 139 #if defined HAVE_GL_2X  defined HAVE_GLES_2X140 132 stdshader = Shader::Create(vertexshader, fragmentshader); 141 #endif142 133 } 143 134 … … 189 180 view_matrix = mat4(1.0f); 190 181 191 #if defined HAVE_GL_2X  defined HAVE_GLES_2X192 182 stdshader>Bind(); /* Required on GLES 2.x? */ 193 183 GLuint uni; … … 196 186 uni = stdshader>GetUniformLocation("view_matrix"); 197 187 glUniformMatrix4fv(uni, 1, GL_FALSE, &view_matrix[0][0]); 198 #else199 glMatrixMode(GL_PROJECTION);200 glLoadIdentity();201 glMultMatrixf(&proj_matrix[0][0]);202 203 /* Reset the model view matrix, just in case */204 glMatrixMode(GL_MODELVIEW);205 glLoadIdentity();206 glMultMatrixf(&view_matrix[0][0]);207 #endif208 188 } 209 189 … … 226 206 void Video::Destroy() 227 207 { 228 #if defined HAVE_GL_2X  defined HAVE_GLES_2X229 208 Shader::Destroy(stdshader); 230 #endif231 209 } 232 210 … … 237 215 int width = v[2], height = v[3]; 238 216 239 #if defined HAVE_GL_ 1X  defined HAVE_GL_2X217 #if defined HAVE_GL_2X 240 218 glPixelStorei(GL_PACK_ROW_LENGTH, 0); 241 219 #endif
Note: See TracChangeset
for help on using the changeset viewer.