Changeset 1222
 Timestamp:
 Apr 13, 2012, 8:31:49 AM (9 years ago)
 Location:
 trunk/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/platform/android/androidapp.cpp
r1219 r1222 12 12 # include "config.h" 13 13 #endif 14 15 #if defined __ANDROID__ 14 16 15 17 #include <jni.h> … … 126 128 } 127 129 130 #endif /* __ANDROID__ */ 131 
trunk/src/scene.cpp
r1221 r1222 130 130 if (data>nbufs > 0) 131 131 glDeleteBuffers(data>nbufs, data>bufs); 132 # if defined HAVE_GL_2X && !defined __APPLE__132 # if defined HAVE_GL_2X && !defined __APPLE__ 133 133 glDeleteVertexArrays(1, &data>vao); 134 # endif134 # endif 135 135 free(data>bufs); 136 136 #endif … … 173 173 #if !defined _XBOX && !defined __CELLOS_LV2__ && !defined USE_D3D9 174 174 stdshader = Shader::Create( 175 # if !defined HAVE_GLES_2X175 # if !defined HAVE_GLES_2X 176 176 "#version 130\n" 177 # endif177 # endif 178 178 "\n" 179 # if defined HAVE_GLES_2X179 # if defined HAVE_GLES_2X 180 180 "attribute vec3 in_Position;\n" 181 181 "attribute vec2 in_TexCoord;\n" 182 182 "varying vec2 pass_TexCoord;\n" 183 # else183 # else 184 184 "in vec3 in_Position;\n" 185 185 "in vec2 in_TexCoord;\n" 186 # endif186 # endif 187 187 "uniform mat4 proj_matrix;\n" 188 188 "uniform mat4 view_matrix;\n" … … 193 193 " gl_Position = proj_matrix * view_matrix * model_matrix" 194 194 " * vec4(in_Position, 1.0);\n" 195 # if defined HAVE_GLES_2X195 # if defined HAVE_GLES_2X 196 196 " pass_TexCoord = in_TexCoord;\n" 197 # else197 # else 198 198 " gl_TexCoord[0] = vec4(in_TexCoord, 0.0, 0.0);\n" 199 # endif199 # endif 200 200 "}\n", 201 201 202 # if !defined HAVE_GLES_2X202 # if !defined HAVE_GLES_2X 203 203 "#version 130\n" 204 # else204 # else 205 205 "precision mediump float;\n" 206 # endif206 # endif 207 207 "\n" 208 208 "uniform sampler2D in_Texture;\n" 209 # if defined HAVE_GLES_2X209 # if defined HAVE_GLES_2X 210 210 "varying vec2 pass_TexCoord;\n" 211 # endif211 # endif 212 212 "\n" 213 213 "void main()\n" 214 214 "{\n" 215 # if defined HAVE_GLES_2X215 # if defined HAVE_GLES_2X 216 216 " vec4 col = texture2D(in_Texture, pass_TexCoord);\n" 217 217 //" vec4 col = vec4(0.5, 1.0, 0.0, 0.5);\n" 218 218 //" vec4 col = vec4(pass_TexCoord * 4.0, 0.0, 0.25);\n" 219 # else219 # else 220 220 " vec4 col = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n" 221 # endif222 # if 0221 # endif 222 # if 0 223 223 " float mul = 2.0;\n" 224 # if 1224 # if 1 225 225 " vec2 d1 = mod(vec2(gl_FragCoord), vec2(2.0, 2.0));\n" 226 226 " float t1 = mod(3.0 * d1.x + 2.0 * d1.y, 4.0);\n" … … 234 234 " t2 = t1;\n" 235 235 " t3 = t1;\n" 236 # else236 # else 237 237 " float rand = sin(gl_FragCoord.x * 1.23456) * 123.456\n" 238 238 " + cos(gl_FragCoord.y * 2.34567) * 789.012;\n" … … 240 240 " float t2 = mod(sin(rand) * 27.13043, 1.0);\n" 241 241 " float t3 = mod(sin(rand) * 37.13043, 1.0);\n" 242 # endif242 # endif 243 243 " float fracx = fract(col.x * mul);\n" 244 244 " float fracy = fract(col.y * mul);\n" … … 250 250 " col.y = (floor(col.y * mul) + fracy) / mul;\n" 251 251 " col.z = (floor(col.z * mul) + fracz) / mul;\n" 252 # endif252 # endif 253 253 " gl_FragColor = col;\n" 254 254 "}\n"); … … 268 268 269 269 "void main(float2 in_TexCoord : TEXCOORD0," 270 # if 0270 # if 0 271 271 " float4 in_FragCoord : WPOS," 272 # endif272 # endif 273 273 " uniform sampler2D tex," 274 274 " out float4 out_FragColor : COLOR)" 275 275 "{" 276 276 " float4 col = tex2D(tex, in_TexCoord);" 277 # if 0277 # if 0 278 278 " float mul = 2.0;\n" 279 279 " float t1, t2, t3;\n" 280 # if 1280 # if 1 281 281 " float dx1 = frac(in_FragCoord.x * 0.5) * 2.0;\n" 282 282 " float dy1 = frac(in_FragCoord.y * 0.5) * 2.0;\n" … … 291 291 " t2 = t1;\n" 292 292 " t3 = t1;\n" 293 # else293 # else 294 294 " float rand = sin(in_FragCoord.x * 1.23456) * 123.456\n" 295 295 " + cos(in_FragCoord.y * 2.34567) * 789.012;\n" … … 297 297 " t2 = frac(sin(rand) * 27.13043);\n" 298 298 " t3 = frac(sin(rand) * 37.13043);\n" 299 # endif299 # endif 300 300 " float fracx = frac(col.x * mul);\n" 301 301 " float fracy = frac(col.y * mul);\n" … … 307 307 " col.y = (floor(col.y * mul) + fracy) / mul;\n" 308 308 " col.z = (floor(col.z * mul) + fracz) / mul;\n" 309 # endif309 # endif 310 310 " out_FragColor = col;" 311 311 "}"); 312 #endif 312 313 } 313 314 … … 339 340 #if defined USE_D3D9  defined _XBOX 340 341 /* Nothing? */ 341 #el se342 #elif !defined __CELLOS_LV2__ 342 343 int attr_pos, attr_tex; 343 #if !defined __CELLOS_LV2__344 344 attr_pos = stdshader>GetAttribLocation("in_Position"); 345 345 attr_tex = stdshader>GetAttribLocation("in_TexCoord"); 346 #endif347 346 #endif 348 347 … … 504 503 glDisable(GL_BLEND); 505 504 #endif 506 #endif /* _XBOX  USE_D3D9 */507 505 } 508 506
Note: See TracChangeset
for help on using the changeset viewer.