Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Opengl 2D Texture Rotation - Simples. Or maybe not.

  1. #11
    which as far as I know can be read from glGetTexParameteriv but this returns an untyped variable which I have no idea on how to get into a longint...
    Use glGetTexLevelParameter with GL_TEXTURE_WIDTH/GL_TEXTURE_HEIGHT instead, because as I see glGetTexParameteriv can't be used with GL_TEXTURE_WIDTH/GL_TEXTURE_HEIGHT.

  2. #12
    For efficiency sake i recommend saving texture width and height in their corresponding texture object when textures are loaded. You do have them in some array/list? Because imagine drawing 10000 rectangles, you don't want to be calling glGet...() for each one.

  3. #13
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Once I rotate a texture, the GlWidth and GlHeight attributes associated to it change and need to be updated. The glGet is only called when the width/height of a texture is actually changed, not when drawn.

    Edit: Though this still does not solve how to fix the fact that glGet... returns an untped variable which FPC refuses to load into a Longint. Every time I get:

    Image.pas(11,26) Error: Incompatible types: got "untyped" expected "LongInt"
    Last edited by code_glitch; 05-03-2011 at 12:19 PM.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  4. #14
    glGet...() are procedures, not functions. Last parameter is a pointer to variable/array depending on which value is being read.
    http://www.opengl.org/sdk/docs/man/x...xParameter.xml

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •