Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OpenGL, cross-platformity, and general nincompoopery

OpenGL, cross-platformity, and general nincompoopery

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestionc++game-devpython
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asday
    wrote on last edited by
    #1

    A future prospective employer mentioned C++ is an excellent language to learn for the field I wish to work in, and especially in their company. "Sounds good" says I. I already taught myself enough Python to have fun with it, C++ seems like a nice language after that. (For precisely the same reasons the languages are different. Strongly typed, compiled, etc.) Now, after wrestling with Google, and the Eclipse SDK, I gave up, (it was going on about "toolchains", and I was thoroughly confused, and couldn't get anything to compile) and installed Visual C++ 2008 EE. All's now well and good, and I'm quickly getting used to syntax, non-dynamic variables, etc. Thing is, I learn to swim faster if I'm in the deep end. Where I left Python, I was trying to implement some sort of primitive 3D rendering with a 2D library, so I figured an acceptable depth for C++ would be some sort of 3D shenanigans. All this, so far, points to DirectX being a likely candidate. No thanks, I'm in this for open-source, cross-platform, hyphenated-fun. So, to OpenGL. In Python, as you can imagine, I'm used to just "import PyOpenGL as og" or whatever. From what I gather, the parallel(s) in C++ is/are libraries. And this is where I deadend. I can't seem to find libraries that aren't windows-specific. Every tutorial I've stumbled upon looks extremely windows-specific, too, one of them mixing OpenGL graphics, with DirectX input or sound modules, or something. (Didn't make sense to me; if you're on windows, and windows alone, why not just use full DirectX?) So, TL;DR version: Cross-platform C++ OpenGL libraries + documentation please. Added bonus question: How do I get Eclipse to work?

    S 1 Reply Last reply
    0
    • A Asday

      A future prospective employer mentioned C++ is an excellent language to learn for the field I wish to work in, and especially in their company. "Sounds good" says I. I already taught myself enough Python to have fun with it, C++ seems like a nice language after that. (For precisely the same reasons the languages are different. Strongly typed, compiled, etc.) Now, after wrestling with Google, and the Eclipse SDK, I gave up, (it was going on about "toolchains", and I was thoroughly confused, and couldn't get anything to compile) and installed Visual C++ 2008 EE. All's now well and good, and I'm quickly getting used to syntax, non-dynamic variables, etc. Thing is, I learn to swim faster if I'm in the deep end. Where I left Python, I was trying to implement some sort of primitive 3D rendering with a 2D library, so I figured an acceptable depth for C++ would be some sort of 3D shenanigans. All this, so far, points to DirectX being a likely candidate. No thanks, I'm in this for open-source, cross-platform, hyphenated-fun. So, to OpenGL. In Python, as you can imagine, I'm used to just "import PyOpenGL as og" or whatever. From what I gather, the parallel(s) in C++ is/are libraries. And this is where I deadend. I can't seem to find libraries that aren't windows-specific. Every tutorial I've stumbled upon looks extremely windows-specific, too, one of them mixing OpenGL graphics, with DirectX input or sound modules, or something. (Didn't make sense to me; if you're on windows, and windows alone, why not just use full DirectX?) So, TL;DR version: Cross-platform C++ OpenGL libraries + documentation please. Added bonus question: How do I get Eclipse to work?

      S Offline
      S Offline
      Sauro Viti
      wrote on last edited by
      #2

      If you want to develop cross-platform GUI applications, the best way is to use a cross-platform framework: this will give you a coherent set of APIs to do almost everything in a platform independant way. The best of them, in my opinion, is the Qt framework (see Qt - A cross-platform application and UI framework[^]): it give you a complete set of functionalities and OpenGL is included. It could be used under three licensing scenarios: GPL, LGPL and Commercial. There exists a Python binding too... Another similar toolkit is the wxWidgets (see http://www.wxwidgets.org/[^]) which is licensed under a modified LGPL license, but I don't know if it supports OpenGL...

      modified on Wednesday, July 21, 2010 3:36 AM

      A 1 Reply Last reply
      0
      • S Sauro Viti

        If you want to develop cross-platform GUI applications, the best way is to use a cross-platform framework: this will give you a coherent set of APIs to do almost everything in a platform independant way. The best of them, in my opinion, is the Qt framework (see Qt - A cross-platform application and UI framework[^]): it give you a complete set of functionalities and OpenGL is included. It could be used under three licensing scenarios: GPL, LGPL and Commercial. There exists a Python binding too... Another similar toolkit is the wxWidgets (see http://www.wxwidgets.org/[^]) which is licensed under a modified LGPL license, but I don't know if it supports OpenGL...

        modified on Wednesday, July 21, 2010 3:36 AM

        A Offline
        A Offline
        Asday
        wrote on last edited by
        #3

        I've heard of both wxWidgedts and Wt, but when using Python, I chose to use GTK+, which lead me to believe that they were... Well, GUI libraries, not 3D libraries. Would using them, instead of pure OpenGL, not add unnecessary overheads?

        S 1 Reply Last reply
        0
        • A Asday

          I've heard of both wxWidgedts and Wt, but when using Python, I chose to use GTK+, which lead me to believe that they were... Well, GUI libraries, not 3D libraries. Would using them, instead of pure OpenGL, not add unnecessary overheads?

          S Offline
          S Offline
          Sauro Viti
          wrote on last edited by
          #4

          Yes, that is true, however consider that OpenGL integrates in the platform-specific windowing system; in other words with ANSI C/C++ and OpenGL only you will be not able to do nothing, you need at least to use the platform-specific API required to access the windowing system. Said that, the little overhead of a cross-platform framework is nothing compared to what it offers you; for instance the Qt give you a class named QWindow that let you create a window in just 2 lines of code (instead of plenty of lines required using the platform-specific API), these 2 lines are always the same on every platform supported, and the window that you obtain is automatically bounded to an OpenGL rendering context, then you can call the standard gl and glu family of functions on it (without the need of writing plenty of lines of code required to create the rendering context, bind it to the window, activate and deactivate it in the right places and so on).

          A 1 Reply Last reply
          0
          • S Sauro Viti

            Yes, that is true, however consider that OpenGL integrates in the platform-specific windowing system; in other words with ANSI C/C++ and OpenGL only you will be not able to do nothing, you need at least to use the platform-specific API required to access the windowing system. Said that, the little overhead of a cross-platform framework is nothing compared to what it offers you; for instance the Qt give you a class named QWindow that let you create a window in just 2 lines of code (instead of plenty of lines required using the platform-specific API), these 2 lines are always the same on every platform supported, and the window that you obtain is automatically bounded to an OpenGL rendering context, then you can call the standard gl and glu family of functions on it (without the need of writing plenty of lines of code required to create the rendering context, bind it to the window, activate and deactivate it in the right places and so on).

            A Offline
            A Offline
            Asday
            wrote on last edited by
            #5

            Sounds good, I'll look into it, thank you very much.

            S 1 Reply Last reply
            0
            • A Asday

              Sounds good, I'll look into it, thank you very much.

              S Offline
              S Offline
              Sauro Viti
              wrote on last edited by
              #6

              If you'd like to have a look to the Qt framework, I suggest you to download this: C++ GUI Programming with Qt4[^] This is the first edition of the official book and is available for download from the Qt website: I remember that there is a chapter specific to the OpenGL...

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups