Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: third_party/gles2_book/Chapter_11/Stencil_Test/Stencil_Test.c

Issue 7740058: Fixed stencil Test example. Writing to stencil buffer was getting disabled after the first frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | third_party/gles2_book/README.chromium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // 1 //
2 // Book: OpenGL(R) ES 2.0 Programming Guide 2 // Book: OpenGL(R) ES 2.0 Programming Guide
3 // Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner 3 // Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner
4 // ISBN-10: 0321502795 4 // ISBN-10: 0321502795
5 // ISBN-13: 9780321502797 5 // ISBN-13: 9780321502797
6 // Publisher: Addison-Wesley Professional 6 // Publisher: Addison-Wesley Professional
7 // URLs: http://safari.informit.com/9780321563835 7 // URLs: http://safari.informit.com/9780321563835
8 // http://www.opengles-book.com 8 // http://www.opengles-book.com
9 // 9 //
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // can test against them without modifying the values we 218 // can test against them without modifying the values we
219 // generated. 219 // generated.
220 glStencilMask( 0x0 ); 220 glStencilMask( 0x0 );
221 offset += 6; 221 offset += 6;
222 for ( i = 0; i < NumTests; ++i ) 222 for ( i = 0; i < NumTests; ++i )
223 { 223 {
224 glStencilFunc( GL_EQUAL, stencilValues[i], 0xff ); 224 glStencilFunc( GL_EQUAL, stencilValues[i], 0xff );
225 glUniform4fv( userData->colorLoc, 1, colors[i] ); 225 glUniform4fv( userData->colorLoc, 1, colors[i] );
226 glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, offset ); 226 glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, offset );
227 } 227 }
228 glStencilMask( 0xff );
228 } 229 }
229 230
230 /// 231 ///
231 // Cleanup 232 // Cleanup
232 // 233 //
233 void stShutDown ( ESContext *esContext ) 234 void stShutDown ( ESContext *esContext )
234 { 235 {
235 STUserData *userData = esContext->userData; 236 STUserData *userData = esContext->userData;
236 237
237 // Delete program object 238 // Delete program object
238 glDeleteProgram ( userData->programObject ); 239 glDeleteProgram ( userData->programObject );
239 240
240 // Delete vertex buffer objects 241 // Delete vertex buffer objects
241 glDeleteBuffers ( 2, userData->vboIds ); 242 glDeleteBuffers ( 2, userData->vboIds );
242 } 243 }
OLDNEW
« no previous file with comments | « no previous file | third_party/gles2_book/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698