Jump to content
  • Advertisement
Sign in to follow this  
PGSCreativeDirector

How to make my own gui using opengl and SDL and C++ or whateva? :)

This topic is 2607 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello im a novice at programming tired of crap and wanting to be less crap by creating things that i can work with but for me too do that i need to know where to start because everything is so dam non logical in the world of coding when theres no explanations or tutorials simplfied word by word on how to do what i want

so im assuming you want to know what i want :P

well this is it

How do i make a Graphical User interface that works ontop of OpenGL and SDL ?

no i do not want to use GLUT or freeGLUT or CEGUI or AntTweakBar

i want to make my own :)

And where did you find information on it because i cant find anything using google ("bet people do that to make it more harder for programmers") * coughs

and i dont want to hear how complex it is ,etc i just want somewhere to start that will give me anuff know how to do it for myself thanks
i really tryed hoping that i didnt have to ask but i guess theres no where else to go so

i aslo wanna state that i learn by learning word for word :) not from massive statements with comments which is just not flexible anuff imo

and ! :D i may sound like i dont know what im doing and thats because i do im guesser / reader :D it works

also i dont want to sound like im bashing just annoyed :)

Share this post


Link to post
Share on other sites
Advertisement
first you need to make objects such as buttons and menus.
If you're just doing this in SDL, you can blit these to the screen and when you flip the screen they will appear.
If you're using opengl with SDL, you need to make objects/plates and display them in ortho mode.

If you don't know what I am on about, you should learn SDL and OpenGL and it will all become clear.

Share this post


Link to post
Share on other sites

so i create a class with a bunch of objects in it using what win32? :) or something else what do i use


For simple things like buttons you really only need to draw a textured quad , change the texture when the mouse moves over that quad or when you click on it (up to you how advanced you want it).

You don't need anything other than SDL (for mouse and keyboard events) and OpenGL (for drawing) to make your GUI.

More advanced controls are obviously more complex and a complete GUI system with customizable controls is a huge undertaking. (Most games don't really need a complete GUI system though, most will do just fine with a few buttons, sliders and input boxes)

Share this post


Link to post
Share on other sites
* You have to define what principles the GUI should follow: A traditional point-&-click GUI? A crossing based GUI? A ZUI? Or what else ...

* A UI does not only consist of a graphical front-end but also has to deal with user input. What input devices do you want to support? Some principles expect a particular kind of input device to be in use.

* Decide what kinds of "widgets" (or whatever the building blocks will be) you need to support.

* Shall internationalization be supported? Which text systems shall be supported?

* Clarify how the UI affects the application data model and how it is supported to read from the data model as well. Do you want to use data binding? Callbacks? Delegates? Signals and slots? Events?

* Shall the GUI be resolution independent?

* Shall the GUI support theming as is often desired (for GUI middleware) for games?

* Shall the GUI be animatable as is often desired for games?

* Shall the GUI (or at least input) be run in an own thread to be e.g. responsive independently on the frame rate? (Okay, this is really advanced ;))


All this (and probably more) has an influence on answering the OP. "Making" a GUI in the sense of rendering is far after planning it.

Share this post


Link to post
Share on other sites
Experience of application GUI programming is certainly a good idea, to see how toolkits should be properly implemented - though he might as well try something in the language he's using rather than (possibly) learning a whole new one. For example, for C++, I'd recommend Qt.

Share this post


Link to post
Share on other sites
I would also recommend to first see how other GUI systems are implemented and then try to roll your own. I'm currently doing the same thing, mostly borrowing concepts from Qt and WPF.

You basic block would most likely be a Widget or Control which has several parameters (position, size, etc.. come in mind). I would keep the inheritance hierarchy very small (most widgets directly inherit from widget in my case) and perfer composition instead. Depending on your needs this will be a huge amount of work (I'm currently two weeks in and have a plan for at least another month of work).

Share this post


Link to post
Share on other sites

hello im a novice at programming tired of crap and wanting to be less crap by creating things that i can work with but for me too do that i need to know where to start because everything is so dam non logical in the world of coding when theres no explanations or tutorials simplfied word by word on how to do what i want

so im assuming you want to know what i want :P

well this is it

How do i make a Graphical User interface that works ontop of OpenGL and SDL ?

no i do not want to use GLUT or freeGLUT or CEGUI or AntTweakBar

i want to make my own :)

And where did you find information on it because i cant find anything using google ("bet people do that to make it more harder for programmers") * coughs

and i dont want to hear how complex it is ,etc i just want somewhere to start that will give me anuff know how to do it for myself thanks
i really tryed hoping that i didnt have to ask but i guess theres no where else to go so

i aslo wanna state that i learn by learning word for word :) not from massive statements with comments which is just not flexible anuff imo

and ! :D i may sound like i dont know what im doing and thats because i do im guesser / reader :D it works

also i dont want to sound like im bashing just annoyed :)


There are a few ways of doing this. The level of complexity and the amount of work that goes into it depends on what features you want. What will your GUI consist of? Screens, buttons, labels, and toggle switches are simple to implement yourself.

Think up a couple of use cases.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!