Re: Drawing Textures and Primitives.



joekeen@xxxxxxxxx wrote:
I can draw images from my texture and then draw all the primitives I
want. However if I draw my primitives first I can't see any texture
data that is draw after that. The function that draws from the texture
to the screen first does the glEnable(GL_TEXTURE_2D) call, draws from
the texture, and at the end of the function does the
glDisable(GL_TEXTURE_2D) call. The primitives just do the normal draw
calls.

Is there anything obvious I'm missing in this? Can anyone point me at
some examples that do what I'm trying?


I'm guessing it's because the wrong texture coordinates
are getting into the pipeline.

Are you using vertex arrays in your primitives? If you
are then make sure you disable the texture coordinate
arrays when you're finished.


--
<\___/>
/ O O \
\_____/ FTB. For email, remove my socks.

In science it often happens that scientists say, 'You know
that's a really good argument; my position is mistaken,'
and then they actually change their minds and you never
hear that old view from them again. They really do it.
It doesn't happen as often as it should, because scientists
are human and change is sometimes painful. But it happens
every day. I cannot recall the last time something like
that happened in politics or religion.

- Carl Sagan, 1987 CSICOP keynote address

.



Relevant Pages

  • Drawing Textures and Primitives.
    ... I'm having trouble interleaving the drawing of textures and primitives. ... I can draw images from my texture and then draw all the primitives I ... However if I draw my primitives first I can't see any texture ...
    (comp.graphics.api.opengl)
  • Re: How to use GDI and DirectX together?
    ... // Draw GDI stuff on surface ... This does not work for me, it must be something im missing! ... D3DXLoadSurfaceFromFileEx and loaded the texture. ... >> I managed to draw some GDI stuff on a surface, using the GetDC funcion, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: OpenGL and SwapBuffers behavior
    ... Then when you want to draw this texture, ... that is not square and a power of 2. ... I have downloaded the current drivers from NVIDIA which do support ...
    (comp.graphics.api.opengl)
  • Re: glDrawPixels bug?
    ... from the image and draw a quad using the texture. ... rotate) and looks nicer (scaled textures can have much ... that first workaround of drawing a texture fixed the problem. ...
    (comp.graphics.api.opengl)
  • Re: 3d carton box printing
    ... label like product code. ... Mesh.Box call and you will have to add texture coordinates to apply the ... GDI printing commands to get it printed. ... Draw a series of 3D carton boxes on the screen ...
    (microsoft.public.vb.directx)

Loading