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

Thread: Loading images in GL

  1. #1

    Loading images in GL

    I was switching to FPC, and in GL I noticed that there was no graphics unit. That's okay but what do I use instead and how? I know there are other ways of loading images to the "texture2d" slot, but what do I do?

    Also what do I use for KB input? The standard dos style input wouldn't be good, so what do I use in place? I'm trying to stay platform independant, just so you know.

    So far I'm stumped! ops:

  2. #2

    Re: Loading images in GL

    Use JEDI-SDL, so that you can still use GL and you have keyboard input and image loading
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  3. #3

    Loading images in GL

    I know, but I don't want to use SDL which I already mentioned. I've got an idea of how to do it, but I'm still unsure.

  4. #4

    Loading images in GL

    Quote Originally Posted by Robert Kosek
    I know, but I don't want to use SDL which I already mentioned. I've got an idea of how to do it, but I'm still unsure.
    Why not? you'll have no problem using it.
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  5. #5

    Loading images in GL

    No offense is meant, but I've been asked the same question about 5 times ... and I've come back to pretty much the same stuff each time. Please take this as final and stop badgering me about SDL. :x

    1) I don't want to wait for header translations, GL is more popular with delphi than SDL. No offense but I don't desire to wait for the CURRENT SDL 2.0 version to have it's header translated.
    2) Input and Window managment are done by GLUT, no fear SDL is not needed.
    3) Unneccesary files! 1.18mb of DLLS for SDL on top of physics and other dlls?
    4) I've got books and have been learning straight gl, I'm not going to try it from a different angle. SDL may use gl but it will be different.

    I've made my choice and am sticking with it, don't badger me. :evil:

  6. #6

    Loading images in GL

    No offense back to you, but SDL doesn?¢_Tt use OpenGL, SDL is used to manage a rendering context for OpenGL, just like GLUT. About the size, the versions of DLL?¢_~s I have are SDL - 232Kb GLUT 168Kb, perhaps you?¢_~re talking about other packages that work alongside SDL, but their optional, and any complicated image format loader will take practically the same amount of space and is it really different if some get compiled into the executable? The reason why many old OpenGl book examples use GLUT is just because it was the first cross platform window manager, that?¢_Ts all.

  7. #7

    Loading images in GL

    Understood, though with that said ... I see no advantage to using SDL. Yes I know it's got networking code and other things, but with indy and a few other pascal things I should be good to go ... I hope.

    What I'm trying to do is load a 24bit bitmap in freepascal, the bitmap info headers aren't in a unit but "struct.inc". How do I load an image based off this code and assign it into a GLUint for texture mapping?

  8. #8

    Loading images in GL

    Here's my code thus far, it loads an image of the format:
    Code:
    Width,Height,Depth&#58; word;
    pData&#58; pointer;
    But is my code FPC compliant? If not what must I fix? (fixed/finished)

  9. #9

    Loading images in GL

    CreateFile, ReadFile etc. are Windows API functions, use streams instead. Why use bitmaps at all, why not use something like TGA, they are basic like bitmaps, but can have an alpha channel.

  10. #10

    Loading images in GL

    1) can't find an FPC compliant unit
    2) since I don't know the format well enough, I made my own format

    I got my unit working, I'll try the stream interface instead though.

    EDIT, Got it converted to using the FileStream.

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
  •