RE: Re: [AD] window resizing |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: <alleg-developers@xxxxxxxxxx>
- Subject: RE: Re: [AD] window resizing
- From: "Robert Ohannessian" <ROhannessian@xxxxxxxxxx>
- Date: Mon, 20 Dec 2004 09:14:56 -0800
- Thread-index: AcTmc5/+/NF3fRtPTCq3aMB9CaD2WgAQ0nMA
- Thread-topic: Re: [AD] window resizing
I agree. Something like check_for_resize() (name to be changed) in the
main draw loop would be a lot better: SCREEN_W/H wouldn't change at
undetermined points in time, there'd be no need for synchronization, and
screen locks can be lifted while the resizing occurs.
Finally, we may need to invalidate all video bitmaps (including the
screen) when a resize happens. Perhaps the signal for this can be a
return value of check_for_resize()? This would allow drivers like OpenGL
to not invalidate video bitmaps (ie: textures) on resize, because it's
not necessary. However, drivers like DDraw will need to be reset, so all
video bitmaps would be lost.
-----Original Message-----
From: alleg-developers-admin@xxxxxxxxxx
[mailto:alleg-developers-admin@xxxxxxxxxx] On Behalf Of
Dustin Dettmer
Sent: Monday, December 20, 2004 1:08 AM
To: alleg-developers
Subject: Fwd: Re: [AD] window resizing
Peter Wang wrote:
> I think SCREEN_W and SCREEN_H would need to be
> deprecated with the
> callback-based design, otherwise you would get
> inconsistent results in
> the following case:
>
> int w = SCREEN_W;
> /* context switch here; window resized */
> int h = SCREEN_H;
>
> You'd probably need a function like
> get_screen_dimensions(int *width,
> int *height), which would lock out the resize
> operation for its
> duration. Even so, that the resize can change the
> screen variable *at
> any time* makes me uncomfortable.
IMO it would be better to leave this up to the user.
The user can supply their own checks for when they
resize the window, and if they're doing this in a
seperate thread, they better be supplying checks. If
they aren't its really their own fault. I don't think
its really a big enough issue to be changing the API
around.
I donno, I guess I just don't like the idea of
changing part of the API that doesn't paticularly need
to be changed. You could replace the macros with
seperate function calls maybe? That would solve some
of the issue...
I also think that the case where a game would want
window resizing is more rare then it is common, and
that the common usage of allegro probably shouldn't be
hindered and / or rewritten to accomodate features it
isn't using.
Maybe I just don't like change that much... ;]
Dustin D.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers