|
Post by DJLinux on Jul 24, 2008 0:14:43 GMT -5
glTexCoordPointer() glColorPointer() glVertexPointer() glNormalPointer() glDrawElements()
why is glDrawElements() not in B4GL ?
|
|
|
Post by Darkjester on Jul 24, 2008 0:22:49 GMT -5
I agree! Is all the functions for using the stencil buffer inplemented in B4gl?
|
|
|
Post by James :) (aka Madcow) on Jul 24, 2008 9:59:55 GMT -5
proberlynot, i think it wasn't implemented becuase tom only wanted a few command in at first to test his basic4gl compiler
|
|
|
Post by Darkjester on Jul 24, 2008 12:22:46 GMT -5
Ill research into it it should have the Glenable(gl_stencil_test) glstencilOp(gl_keep, gl_Always,gl_replace,gl_equal_ glclearstencil() Glclear(gl_stencil_buffer_bit) glstencilfunc() thats all i can think of right now! Im sure their a couple more that i dont know!!
|
|
|
Post by DJLinux on Jul 25, 2008 4:30:57 GMT -5
Ill research into it it should have the Glenable(gl_stencil_test) glstencilOp(gl_keep, gl_Always,gl_replace,gl_equal_ glclearstencil() Glclear(gl_stencil_buffer_bit) glstencilfunc() thats all i can think of right now! Im sure their a couple more that i dont know!! the stencil things works fine in B4GL i tested it with the volume shadows. Joshy
|
|
|
Post by Tom Mulgrew on Jul 25, 2008 20:31:39 GMT -5
glTexCoordPointer() glColorPointer() glVertexPointer() glNormalPointer() glDrawElements() why is glDrawElements() not in B4GL ? Hi, They are not implemented because they contain pointers, and I don't understand how they are supposed to work. Most of the OpenGL functions were implemented by a little program I wrote that scans the OpenGL header file and builds Basic4GL wrapper functions for each one. The ones that accept pointers to data I had to do myself though, because Basic4GL's memory format does not always what the function expects. So I had to write code to convert the data to/from Basic4GL format, and also to make sure . But in order to do that though I had to understand how the OpenGL function works and what it is meant to do. So I decided I'd leave those ones out unless someone really wanted them, and was prepared to explain to me how they work and what they are supposed to do. -Tom
|
|
|
Post by Darkjester on Jul 25, 2008 22:30:57 GMT -5
Could you explain this scanner?
|
|
|
Post by James :) (aka Madcow) on Jul 26, 2008 1:36:15 GMT -5
Scanner?
basicly he wrote a function that got all the opengl functions and made them work in basic4gl. but some of them did not work this way so tom had to write 1 function for each one that didn't work so that it would work in basic4gl. but some of them tom coudn't figure out how they worked or how to get them to work with basic4gl so he gave up and left them out.
hope this is right tom.
maybe if you were to edit toms basic4gl source you could try and add it in?
unless tom wants another stab?
|
|
|
Post by DJLinux on Jul 26, 2008 13:00:07 GMT -5
hello tom if you compare this two codes you will see that glDrawElements() can be faster in your vm too if we put it in a plugin the step to get the arrays from your vm to the plugin will eat the plus on speed. so it would be nice if you implement it directly in your B4GL. short and fast version: glTexCoordPointer( 2, GL_FLOAT, 0, waterTexCoord ) glColorPointer( 3, GL_FLOAT, 0, waterColor ) glVertexPointer( 3, GL_FLOAT, 0, waterGrid ) glNormalPointer( GL_FLOAT, 0, waterNormal ) glDrawElements( GL_TRIANGLE_STRIP, indexCount, GL_UNSIGNED_INT, waterIndex ) the slow "normal" version: ' not so good for j = 0 to WATERY-2 glBegin(GL_TRIANGLE_STRIP) for i = 0 to WATERX-1 x = i % (WATERX-1) y = j % (WATERY-1) y1 = (j+1) % (WATERY-1) k =(x and (WATERX-1)) + (y and (WATERY-1)) glColor3fv(WaterColor#(k * WATERX)) glNormal3fv(WaterNormal#(k * WATERX) ) glTexCoord2f( i * 0.08, j * 0.08 ) glVertex3fv( WaterGrid#( ( k * WATERX ) * 3 ) )
glColor3fv(waterColor#(( (x and (WATERX-1)) + (y1 and (WATERY-1)) * WATERX ))) glNormal3fv(waterNormal#( (x and (WATERX-1)) + (y1 and (WATERY-1)) * WATERX )) glTexCoord2f( i * 0.08, j * 0.08 + 0.08 ) glVertex3fv(waterGrid#( ( (x and (WATERX-1)) + (y1 and (WATERY-1)) * WATERX ) * 3 )) next glEnd() next here are a nice demo: water.zip
|
|
|
Post by Darkjester on Jul 26, 2008 23:49:09 GMT -5
I noticed when i couldnt see your water very well so i found this image to replace the bumpmap texture! here
|
|