Announcement

Collapse
No announcement yet.

OpenGL and DirectX questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenGL and DirectX questions

    Couple of questions...

    Does anyone know how to load BMP and JPEG files into an OpenGL texture using PowerBasic? I kind of have BMP files worked out (from sublevel 6's OpenGL examples) but can't find anything on JPEG. I took a look at some of the code on NeHe's site (excellent OpenGL tutorials -- nehe.gamedev.net) and found some samples in C++ on how to load JPEG's, but they are pretty involved and difficult (at least for me) to translate.

    Also, I know PB can't interface directly to DirectX. Would it be practical to make a wrapper to DirectX calls in C and then call that from PB? Or would that add too much overhead?

    I am working on some very graphic intensive software, and would like to have DirectX support. Since that is not possible for the moment in PB (I need full access to DirectX, mostly Direct3D, so plotting pixels in assembler as shown on this message board will not do), I am using OpenGL, but hitting wall after wall in trying to do basic things, like load JPEG files and use OpenGL extensions like multitexturing.

    Is there anyone out there (sorry, just have to quote Pink Floyd when possible) that has any experience with PB and OpenGL/DirectX? If so how are you doing it? Any advice or pointers you could show me?

    Thanks for the help,
    Flick

    ------------------

  • #2
    I've heard about the following tool
    www.powerrender.com

    But I don't know a lot of details, I don't have any experience on 3d
    programming.

    (well, I wrote a 3D engine for DOS a long time ago, but it couldn't do a
    lot except wireframe and a bit of texture mapping)

    Best Regards

    ------------------

    Comment


    • #3
      Also, I know PB can't interface directly to DirectX. Would it be
      practical to make a wrapper to DirectX calls in C and then call
      that from PB? Or would that add too much overhead?
      JAZZAge can get you there: http://www.jazzagesoft.com

      Or, perhaps Fastgraph is what you want: http://www.fastgraph.com

      Writing a wrapper for DirectX is not likely to require any significant
      overhead, unless you're planning on drawing a few million pixels, one
      at a time.

      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


      • #4
        Originally posted by Tom Hanlin:
        JAZZAge can get you there: http://www.jazzagesoft.com

        Or, perhaps Fastgraph is what you want: http://www.fastgraph.com

        Cool, thanks for the help! I'll check them out.

        Thanks again,
        Flick

        ------------------

        Comment


        • #5
          Bryan,

          I haven't done a great deal of OpenGL programming, but I have bought myself a copy of the "OpenGL Super Bible". That's a great book for OpenGL programming, and the answer (and simple C example) for multiple texture objects is given in Chapter 8.

          I will try to track down the C source code next time I get home and e-mail it to you if you contact me off line.

          Regards

          Andrew

          ------------------
          --------------
          mailto:[email protected][email protected]</A>
          --------------
          andrew dot lindsay at westnet dot com dot au

          Comment


          • #6
            Hi! I also found NeHe's tutorial's EXTREMELY helpful (Everyone interested in trying out OpenGL should visit their site - Highly recommended!). Anyway, at the bottom of each tutorial (there are 41 at present!) there are links to different versions of the code used in each tutorial in everything from Delphi to Fortran to Powerbasic! Well, actually only the first 6 lessons were translated for PB by Angus Law (of Sublevel 6). But most of the rest are translated in at least Visual Basic so you can get an idea of what to do.
            [note to webmaster: I'm typing in this text window, waiting for the words to wrap to the next line but it never happened. Can I change this?]

            Anyway, speaking of OpenGL, there's a very funny and interesting comparison of DirectX vs OpenGL written by the guy who wrote Doom (He blasts DX for its' stupid API, and vows never to use it for technical and ethical reasons (You wouldn't believe how sneaky MS was during the development of OGL...or maybe you would

            Do a search for "Powerbasic OpenGL" and you'll find quite a few helpful files for learning and programming in OpenGL.

            Russell

            p.s. You can also find some good OGL and DX stuff for PB here: http://www.xlsior.org/code/various/pbnewa.html
            ------------------
            If 100% better means twice as good, then how come 200% better doesn't mean 4 times as good, since it's twice as much as 100%?

            [This message has been edited by Russ Jones (edited April 09, 2003).]

            Comment


            • #7
              Originally posted by Russ Jones:
              Do a search for "Powerbasic OpenGL" and you'll find quite a few helpful files for learning and programming in OpenGL.

              Russell

              p.s. You can also find some good OGL and DX stuff for PB here: http://www.xlsior.org/code/various/pbnewa.html
              Awesome! I'll check it out... And yes, it is my understanding that Microsoft was pretty sneaky with OpenGL. From what I understand they pulled out of the OpenGL Architecture Board completely recently to focus on DirectX. I think the computer graphics community would be much better off with an open standard instead of having a single standard that only runs on Windows. I would certainly like to stick with OpenGL, especially if there is a Linux version of everyone's favorite Basic compiler!

              Thanks again,
              Flick

              (Edited to correct stupid spelling mistakes!)



              [This message has been edited by Bryan Flick (edited April 12, 2003).]

              Comment

              Working...
              X