Create a new open GLWindow and instert a picture [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I would like to create a window using open GL but i can't find any good tutorial, can anybody tell me one?
Once the window will be create, i want to insert a picture on it!

This isn't how openGL works (inserting pictures inside).
To draw a picture you will need to create a quad and then assign a texture to it.
For a tutorial, google Hello Triangle openGL then move from that point forward.

This question is aleready asked several times before. As MichaelCMS mentioned. This is not how OpenGL works. You can do this (creating a window and insert a picture) with Qt too.
See here, here or here.
Creating a window doesn't depend on OpenGL. You can use GLUT or the Qt Libarys to do this platform independent. There exist a lot of tutorials for this.
For a GLUT-tutorial, see here, here or here.
For a tutorial for Qt, see here. Qt offers a lot of own classes for a easier use of OpenGL too.

Related

Create OpenGL context in Qt [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm currently developing an OpenGL application and I want to use Qt for the other stuff. I want to use OpenGL like I use it with GLFW and without Qt functions. Just normal OpenGL. I cant find any site which uses Qt like id like to. So I only want to use Qt for the Windows and creating context and so on, but use OpenGL for the rest.
Thanks for your time.
There is an old-school QOpenGLWidget that will create an OpenGL context. That will give a window with an area to draw on.
Other option is the Scene Graph - OpenGL Under QML - pretty much the same, but it also allows to have QML user interface (buttons, edits, etc.) above your OpenGL rendering.

Best way to display GUI [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to find out what's the best way to display a custom design GUI for a windows application? (I wouldn't mind cross-platform compatibility but windows is enough for now ;) )
I tried using DirectX but the problem with DX is, that you are forced to either use textured quads or render shapes other than quads or triangles with a lot of vertices... I'd prefer NOT to use bitmaps due to the limited resolution. Also a problem with DirectX is, that it doesnt run on systems without a compatible graphics card...
I don't want to use any librarys like Qt or such... I want to do it by myself, I just don't know where to start... Basicly what I'd like to have as a result is something like the GUI of NI's Traktor... (picture below) I have noticed that Traktor runs basicly everywhere (so I think it does not rely on GPU). Any suggestions?
You could do all your drawing in WM_PAINT
Use BeginPaint
Create your object
SelectObject
Draw your stuff or what ever
Then DeleteObject
You can even make a colour Transparent
If you want to draw your GUI in a different shap
Use SetLayeredWindowAttributes set the colour that you want transparent
Also look up Custom Draw
There are alot of examples out there
If you want to stick with windows, you can use GDI.
I'd prefer NOT to use bitmaps due to the limited resolution.
You can always create bitmaps dynamically. There are lots of open source libraries to help with the drawing, or you can use GDI for this again.

What is the right way to use a QStateMachine for a text adventure game? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have seen a couple topics about this already but they were a bit vague for me so I decided to make this. I'm working on a little adventure game just for fun in Qt, its basically just text on the screen and the player inputs commands into a line edit widget which I then process and do the related action/event. Thing is, I am a little confused on how to approach this. I don't want to dig myself a hole by manually coding in lots of commands and events per room because it seems to just be a pain later on. So then I thought about using some sort of database to store the information but which one should I use? I would love some advice from people who have tried something similar.
And here, these pictures are a rough outline of what I am trying to do.
Flowchart of states
Level tiles
Edit: I should add, the tiles for the level basically work like this. The light gray is a direction the player can move in, the dark gray parts are walls and the colors are various different actions you can do.
I don't particularly care for code, but I would like suggestions on what tools to use for this and maybe how to set them up right. Someone must know.

Drawing a temporary 'select' rectangle on a drawing area [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have a complex drawing on a Gtk DrawingArea widget and I wish to provide the user with a way to select a rectangle on it to expand for a closer view. I have managed to get the necessary mouse button events sorted out so that the rectangle can be selected, but it would be desirable to have the actual rectangle drawn on the display, moving around along with the mouse. I need to know how one does this without disturbing the underlying drawing (i.e. so I can erase the temporary rectangle as it changes size and shape without having to redraw the underlying picture).
Could someone tell me the correct name for this effect (so that I can google it) or does anyone know of an example, or a keyword to search the Gtk documentation?
Thank you.
You are looking for the Rubber Band technique.

Easy-to-use GUI that is zoomable and pannable? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am looking for a GUI toolkit that is easy to use and cross-platform. Another major requirement of the GUI is that it should support zoom and pan. For example, I should be able to zoom in on a picture and enlarge buttons.
Something like this:
http://eaglemode.sourceforge.net/video.html
But it should have Windows support also (which to the best of my knowledge Eagle Mode doesn't have).
From what I understand, QT is a good UI and it can draw right on top of the OGL window. I think it resets the matrix before drawing the buttons. If I can prevent that reset, the GUI can be zoomed along with the rest of the items. Is there a simple hack to do just that?
Thanks,
This is doable in Qt 4.4 and above using the Qt Graphics View Framework. It makes it very easy to make these types of interfaces, since Widgets can now be placed on the scene (QGraphicsScene) using QGraphicsWidget and QGraphicsLayout.
The framework supports zooming, panning, rotating, etc - with animation.
Take a look at Piccolo2D, which has Java and .NET bindings.
It is the successor of Pad++, which was well ahead of its time: