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

Thread: window

  1. #1
    Join Date
    May 2012
    Beans
    103

    window

    hey,

    Im creating an opengl cross-platform game engine. Im done with Windows, now I want linux support. How do I create a window in linux WITHOUT any 3rd party libraries like Qt or something. SRSLY, I CANT GOOGLE ANY SOLUTION WITHOUT THE USE OF THESE LIBS. I want my engine to provide the low level itself. On windows, I used the standard win API. Is these also a standard windows manager in linux? BTW im reasonably new to Linux. language: C++/C;

  2. #2
    Join Date
    Nov 2011
    Beans
    56

    Re: window

    Quote Originally Posted by thedardanius View Post
    hey,

    On windows, I used the standard win API. Is these also a standard windows manager in linux?
    No there isn't a standard window manager in Linux.

    The only thing approaching the Windows API on Linux would be using Xlib.

    Xlib provides the tools to build a user interface but it does not directly specify menus, scroll bars, dialog boxes or how your application will respond to user input.

    In order to create an OpenGL Window you would use Xlib and GLX.
    GLX is an API that provides OpenGL functions to an X Window System application.

    I can tell you that it will be a lot of work and time for you to program all these GUI widgets yourself just using Xlib. That has already been done by the higher level graphics library toolkits.

    If you only used Xlib to create your GUI then your application doesn't need any GUI libraries (Xlib is standard on every Linux distribution). Just remember Xlib only provides a way to create a GUI but all the hard work of responding to user input and Windows and text, colours, dialog boxes..etc will have to be programmed by you.

    I don't recommend that at all just use a GUI toolkit, there are many good ones to choose from and I'm sure there's one that will suit your needs.

    Otherwise time that you could be spending on your application will be spent learning Xlib and creating GUI widgets, and the result will never be as good as just using a toolkit.
    Last edited by xytron; October 28th, 2012 at 09:09 PM.

  3. #3
    Join Date
    Mar 2006
    Beans
    837

    Re: window

    Quote Originally Posted by thedardanius View Post
    hey,

    Im creating an opengl cross-platform game engine.
    Maybe you should look at SDL or Ogre3d

  4. #4
    Join Date
    May 2012
    Beans
    103

    Re: window

    thanks, xlib ang glx is waht im looking for. you coudl also say:
    why didnt you use qt on windows? why didnt you use glut.
    Well for those lazy *sses out there:
    - I want to learn how these things work
    - I want my engine to be complete independatn from the libraries, so the engine should ahndle all the low level things, what I did on windows. SO on linux, it shouldn't be that different. I need to study some linux anyway ;p

  5. #5
    Join Date
    May 2012
    Beans
    103

    Re: window

    no thanks...

  6. #6
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: window

    I just want you to reflect on something. On one hand, you're completely comfortable in Windows with using the standard Windows API. But on the other hand, you are completely uncomfortable in using any library on GNU/Linux OS. I really don't get it.

    And no, the low-level thing doesn't count for me. The Windows API is quite high-level.

  7. #7
    Join Date
    May 2012
    Beans
    103

    Re: window

    well its like this:
    I dont want my engine to use any 3rd party dependancies. I expect x windows system and glx to be available on every linux system. Its like the win API is available on all the windows NT.

  8. #8
    Join Date
    May 2012
    Beans
    103

    Re: window

    BTW the winAPI is quite low level, you need to do message handling and window creating yourselfs, just like in glx and x11

  9. #9
    Join Date
    May 2008
    Location
    UK
    Beans
    1,451
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: window

    Quote Originally Posted by thedardanius View Post
    BTW the winAPI is quite low level, you need to do message handling and window creating yourselfs, just like in glx and x11
    From memory though The windows API though has calls to create buttons, menus on your windows, will tell you relative co-ordinates of mouse moves, will tell you when a given widget is actually clicked on by the mouse etc. It handles things like scroll the contents of lists for you, the contents and state or the widgets. repaint the windows one manus and pop-ups are deleted etc etc etc.

    The XLib API does not - you paint a region on a screen and you get told where on the screen the mouse was clicked - you have to work out if that mouse click was on part of your region that you are interested in, and if that region is a menu, or button, or combo box, or a list , and how they scroll etc etc etc.

    Xlib is much lower level than Windows API - or it's linux equivalents like QT, KDE or GTK.
    Tony - Happy to try to help.
    Unless otherwise stated - all code posted by me is untested. Remember to Mark the Thread as Solved.
    Ubuntu user number # 24044 Projects : TimeWarp - on the fly Backups

  10. #10
    Join Date
    May 2012
    Beans
    103

    Re: window

    you definitely never programmed with winAPI before? WinAPI has the lowest level things for C to program on windows. you're prbably refering to MFC, a thin layer upon WINAPI.
    Btw I took a look at xlib, and it appears to my eye and experiences to be just slightly lower level than winAPI.

    THanks anyway.

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
  •