Page 1 of 2 12 LastLast
Results 1 to 10 of 24

Thread: FBOs and OpenGL Extensions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45

    FBOs and OpenGL Extensions

    Well, long time no see PGD! Looks like I found some trouble though and after a few days of googling in the dark nothing seems to have solved my problem(s) while implementing some FBO goodness in OpenGl.

    Issue number 1:
    On my desktop (ATI 5750 w/ fglrx and mint 11 64 bit) fpc spits out things that look like this:
    Code:
    FrameBuffer.pas(38,37) Error: Identifier not found "GL_FRAMEBUFFER"
    which is unnafected by whether I do
    Code:
    glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
    or
    Code:
    glBindFramebuffer(GL_FRAMEBUFFER, 0);
    which doest happen on my laptop (Intel GMA 4500MHD) which is weird. I tried downgrading FPC from 2.6.0 to 2.4.4 with an "apt-get --purge fpc fp-*" but no luck, apparently fpc denies all existence of GL_FrameBuffer O.o As to why, I have no clue since I put gl, glu and glext under the uses section...

    Issue number 2:
    Once I compield it on my laptop with the intel card there were no issues, until I ran it in GDB which is convinced that
    Code:
    glGenFrameBuffersEXT(1, @FrameBufferID);
    as well as
    Code:
    glGenFrameBuffers(1, @FrameBufferID);
    crashes the program and doesnt identify a cause other than:
    Code:
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Cannot find new threads: generic error
    Anyone have any ideas as to what I should hit up next? I'm totally lost on this one....
    Thanks.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  2. #2
    Code:
    FrameBuffer.pas(38,37) Error: Identifier not found "GL_FRAMEBUFFER"
    This is simple compiler error. You are using something that's not found in the namespace. Check that you have right OpenGL header unit in the uses list, and that GL_FRAMEBUFFER is defined there at interface section. Check that header version is same on both computers.

    The above might solve your second problem, but if it doesn't, make sure that header has initialized those functions (glGenFrameBuffers...).
    (Also you need to have a render context ready.)

  3. #3
    Quote Originally Posted by code_glitch View Post
    Issue number 2:
    Once I compield it on my laptop with the intel card there were no issues, until I ran it in GDB which is convinced that
    Code:
    glGenFrameBuffersEXT(1, @FrameBufferID);
    as well as
    Code:
    glGenFrameBuffers(1, @FrameBufferID);
    crashes the program and doesnt identify a cause other than:
    Code:
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Cannot find new threads: generic error
    Anyone have any ideas as to what I should hit up next? I'm totally lost on this one....
    Thanks.
    I'm guessing that you have something like this in your main FP program code?

    Code:
      {$IFDEF UNIX}{$IFDEF UseCThreads}
      cthreads,
      {$ENDIF}{$ENDIF}
    If not, this might help...

    Just a thought

  4. #4
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Thanks for all the fast replies and sorry for this late one, I just got off the phone from BT whom now admit the line fault was their doing efter an hour of 'your extension wiring is faulty and is not done by BT...' when I've got the modem hooked into their test socket.... Anyway, I digress.

    User137: Thats what baffled me: the opengl headers come from the same package and are thus identical on both machines - why they differ is beyond me O.o

    Paul: Yes, the glGenFrameBuffers() is in the main program code and you're right in including cthreads as it is a common unit often ommited form some code that causes issues later. However, in this case its inclusion seems to have no effect and the behaviour GDB reported earlier continues to occur.

    After now 5 days of tweaking this and searching high and low I've found that in C/C++ and other such languages, glGenFrameBuffers is a pointer and must be set to the actual procedure. Is this the case with the header files in fpc? And if so does anyone have any ideas where I might find some example code/documentation?

    Thanks
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  5. #5
    I use dglOpenGL headers. Some say fpc headers are outdated. Additional bonus is that dglOpenGL works for Delphi and fpc.

  6. #6
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Speaking of "outdated," aren't FBOs supposed to be obsolete with the newest version of OpenGL? At least that's what I've been told not too long ago.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  7. #7
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    I must admit to having heard something similar to you WILL though my issue with a lot of the new OpenGl stuff is that a lot of computers I use are knocking on 3 years of age and although all but one are intel GMA chips the standard of the new OpenGl implementations seems to vary greatly (*cough*ATI*cough*). Oh, and I still havent come accross much in the way of tutorials and native FPC support (I'm lazy when it comes to unit hunting )

    Of course if anyone has any pointers in these departments all suggestions are welcome Especially since I'm not getting any luck on this front...
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  8. #8
    Quote Originally Posted by WILL View Post
    Speaking of "outdated," aren't FBOs supposed to be obsolete with the newest version of OpenGL? At least that's what I've been told not too long ago.
    Why on earth would FBOs be outdated? I mean, replaced by what? I know that so much OpenGL is gone in 3.2 and up, but not FBOs.

    And as mentioned in other parts of the thread, FBOs are not deprecated but core functionality, at least last time I looked.

  9. #9
    Quote Originally Posted by code_glitch View Post
    Thats what baffled me: the opengl headers come from the same package and are thus identical on both machines - why they differ is beyond me O.o
    Did you actually verify that they differ? It should propably be mentioned in the beginning of header. Do you have same FPC and Lazarus versions on both computers?

  10. #10
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Its the fact they DONT differ across platforms (their md5sums are the same - to be expected if you install from the same tarball ) and yet throw up different errors which baffles me. I also happen to have no lazaruses and the fpc version is exactly the same - 2.6.0 - (probably due to them being installed from the same tarball )

    And to be on the same side I did do a
    Code:
    sudo du -ah / | grep -i /gl.ppu
    Just to make sure there were any other gl.ppu headers anywhere There werent...

    My issue with OpenGl 3 is the the GMA4500MHD chips in one of my laptops is OpenGl 2.1 only which happens to be overly popular in england at the moment since we've now had about 3 years of intel fever where every ad break would have at least one advert from currys and pc world advertising the fact that a 'intel graphics' are better -_-
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

Page 1 of 2 12 LastLast

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
  •