Archived

This topic is now archived and is closed to further replies.

asafbd

Does glReadPixels/glDrawPixels work with VB 6.0

Recommended Posts

General: Hi, I have a problem with the pixel procedures in visual basic. I’m trying to read the pixels using: glReadPixels 0, 0, w1, h1, rpDepthComponent, pxlFloat, Zbuf(0) And then clear the depth and color buffer using the following: clrColorBufferBit Or clrDepthBufferBit And in order to draw only the Z-Buffer pixels I’m using: glDrawPixels w1, h1, pfLuminance, pxlFloat, Zbuf(0) Problem: The problem is that when I’m clearing the buffer and drawing the pixels it looks like The procedure isn’t working and the scene looks empty. More info: 1.This code works properly when invoking it in visual C++ and in VB it fail to work. 2. Do you know about a problem with glReadPixels/glDrawPixels in VB? 3. Did somebody use it in the past with visual Basic 6.0? Plain code: glPushMatrix ''save curent MODELVIEW matrix glReadPixels 0, 0, w1, h1, rpDepthComponent, pxlFloat, Zbuf(0) glClear clrDepthBufferBit Or clrDepthBufferBit glMatrixMode mmProjection glPushMatrix ''save current PROJECTION matrix glLoadIdentity glDrawPixels w1, h1, pfLuminance, pxlFloat, Zbuf(0) glFinish SwapBuffers PictOGL.hDC glPopMatrix ''Restore PROJECTION matrix glMatrixMode mmModelView glPopMatrix ''restore MODELVIEW matrix

Share this post


Link to post
Share on other sites