-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embed qt and allegro in d3d #661
Conversation
@@ -92,6 +92,9 @@ struct ALLEGRO_DISPLAY_WIN | |||
int toggle_w; | |||
int toggle_h; | |||
|
|||
//allegro don't manager the display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"manage"
This is interesting, have you tested how this handles display resets? E.g. start your program, press ctrl-alt-delete, cancel out of that and then see if your program still works? |
Oh... I didn't handle this. let me fix it. |
I made a new commit. Now it could handle device lost. But there are some limits. If let allegro use existing window, you must handle device lost and resize window by yourself. So people must create their own qt or mfc widget. I made a qt widget to help others, so where can i upload it? |
How big is this widget? If it's small enough, we could make a |
The widget is not big. Just 2 files and less than 200 lines. But it dependence qt. |
That's fine, we have an |
So, should I upload a ex_qt.cpp? But I don't know how to use cmake. |
…vice lost when use existing window.
82c1c5b
to
4c978d4
Compare
I upload 3 new files. Compile and run succeed in qt 5.5. |
|
…initiated(). Signal initiated emitted after init().
lol Don't load bitmap in QAllegroCanvas' Constructor. I call init() in showEvent(), and it worked. |
This could get the window size from the HWND and use it rather than the values passed to al_create_display. Those would be ignored kind of like they are for FULLSCREEN_WINDOW. |
You mean ignore FULLSCREEN_WINDOW when use exist window? |
No I meant do you think it would be better if the patch determined the size of the ALLEGRO_DISPLAY based on the HWND the user uses? |
There are functions like GetWindowRect that can get the size from an HWND. |
…vice lost when use existing window.
…initiated(). Signal initiated emitted after init().
…PLAY based on the HWND that user uses(ignore al_create_display()'s two parameters:w and h).
…into Branch_EmbedQt
I have make a new commit. It worked.
The code will get right width and height. |
Thanks for changing that! |
A new commit! |
I post a topic on allegro forum https://www.allegro.cc/forums/thread/616419.
It only work in d3d. I don't know how to resize the display in opengl.
It works like this: