Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [A5.0.2] SetWindowPos vs ALLEGRO_DISPLAY

This thread is locked; no one can reply to it. rss feed Print
[A5.0.2] SetWindowPos vs ALLEGRO_DISPLAY
komons
Member #11,083
June 2009

Hi here is my issue:

I change window size by SetWindowPos (HWND from display), and then my display automaticaly change himself too.
:<

I need this for smoothly resizing display with noframe flag.

Assume that we have display 100x100px, and the window has resized to 10 pixels more.

First I set display size from 100 to 150, and Second step is set size just a window to 110.

We have display 150 and window 110.

Third step, when I click up a mouse, I set display size to window size.

By this way, display resizing isn't called many times, only every 50 pixels. But like I said, display size change automaticaly to window size.
:<

Evert
Member #794
November 2000
avatar

I'm not entirely sure what you're saying, but you seem to be using Windows-specific functions to resize an ALLEGRO_DISPLAY. That doesn't seem like the best way to do whatever it is you're doing.
Why don't you use al_resize_display() and Allegro's other display manipulation functions to do that?

komons
Member #11,083
June 2009

No no no :) I need to resize window but without resizing display. Is it possible?
Like Display 100px but window 50px.

I try to make smoothly resizing window with noframe flag.

Evert
Member #794
November 2000
avatar

komons said:

No no no :) I need to resize window but without resizing display. Is it possible?

In response to a resize event, possibly, by not acknowledging the resize so the backbuffer remains the old size.
But why do you want that? To me, what you're doing sounds fundamentally broken, so I'm curious what exactly you're trying to do and why?

komons
Member #11,083
June 2009

Okay I try make resizing display, but this display have ALLEGRO_NOFRAME flag, so I can't just use ALLEGRO_RESIZABLE with it.

Evert
Member #794
November 2000
avatar

komons said:

Okay I try make resizing display, but this display have ALLEGRO_NOFRAME flag, so I can't just use ALLEGRO_RESIZABLE with it.

That just means that you cannot resize the window by dragging the frame, which makes sense since it doesn't have one. :P
You can still resize the window from your code by calling al_resize_display().

Go to: