![]() |
|
Allegro5 with GTK, QT or Wxwidgets |
aniquilator
Member #9,841
May 2008
![]() |
Hello everyone! I know that allegro now uses(can use, i think) openGL to render its graphics, is there a way to get the opengl window handler, or somethink like this? case with QT, I can embed an opengl window with my gui. Please help me, I read a lot about allegro5 possible guis but. I dont really need an ingame gui, WHAT I NEED is a gui, with an allegro5 window embed... So thats it, i would really appreciate your help. Thanks in advance. If you wanna know exactly what i will remake see this, maybe you can understand better: |
Thomas Fjellstrom
Member #476
June 2000
![]() |
I'd probably just use Qt's or OpenGL functions to do the drawing if I was going to the trouble of making a tool for a game in Qt. But I think you might be able to mix Qt and Allegro 5 if you make sure to handle allegro 5 messages in with the Qt messages. I assume that'd be done using the QEventLoop stuff. And after that you'd grab the window id from allegro, and tell Qt to embed that window in one of its own widgets. That part is going to need platform specific code though. -- |
aniquilator
Member #9,841
May 2008
![]() |
Hey, thanks, i will to try to look at QEventLoop. Now I could initiate a application in Qt, and display an allegro window, but when I quit the application, it seems that the allegro don't let qt finish it all. Do you know why? I just put this code in the constructor of my widget: And I put this code in the destructor of my class:
I works fine, It inits, create the display, and show the quit message properly, but the application, stills running.. Edit: 1int x=10,y=10;
2int W=50,H=50;
3
4al_set_target_backbuffer(mydisplay);
5al_draw_filled_rectangle(x, y, x + W, y + H, al_map_rgba_f(1, 0, 0, 1));
6al_draw_bitmap(bmp, 100, 100, 0);
7al_draw_filled_rectangle(0, 0, W, H, al_map_rgba_f(1, 1, 0, 0.1));
8al_flip_display();
About the things being drawn into the Qt widget, its ok, even better to me, I just need to know how to hide the allegro display now. In addiction the rectangles are being drawn correctly, but the BITMAP just show a white rectangle... It doesn't show the image itself. I made a program to test the image, and it shows ok. Edit: Edit: So, after that I start to mess around with GTK. And I got better results. =) Allegro can draw everything in an openGL widget! =) thats right everything works, and the best: The application quits properly. Now what I have to do is to stop creating the allegro display... Is There some way to tell allegro to use a openGL context, and not create its own display? If there's a way every gonna be almost perfect! LOL8-) |
|