Page 1 of 1

screensize bugs

PostPosted: 03 May 2012, 00:06
by ctdabomb
several bugs about different resolutions:

1. can make your resolution bigger than your monitor.

2.when bug one happens, the save button is out of sight, and there is no way to manually fix the window size.

3.on bigger resolutions, icons and buttons disappear. (see picture(record image missing))

Re: screensize bugs

PostPosted: 03 May 2012, 05:22
by acme_pjz
:| ............. :think: I think we should use SDL_ListModes() instead of hardcode a lot of predefined screen resolutions :| And we should use the sizable window under non-fullscreen mode...

Re: screensize bugs

PostPosted: 03 May 2012, 06:49
by Edward_Lii
Hello ctdabomb,

ctdabomb {l Wrote}:2.when bug one happens, the save button is out of sight, and there is no way to manually fix the window size.

In most window managers you can move the window beyond the screen edges by holding the alt-key while dragging the window.
This way you can move the window in a way that you can reach the Save Settings button.

acme_pjz {l Wrote}::| ............. :think: I think we should use SDL_ListModes() instead of hardcode a lot of predefined screen resolutions

I see you've implemented this, one problem is that most monitors support 640x480 which is lower than our minimum supported resolution (800x600).
We should filter out resolutions that are smaller than 640x480.

acme_pjz {l Wrote}:And we should use the sizable window under non-fullscreen mode...

That's a great idea, I assume upon resizing the game would receive an event from SDL?

Re: screensize bugs

PostPosted: 03 May 2012, 07:24
by acme_pjz
Hi,

Edward_Lii {l Wrote}:I see you've implemented this, one problem is that most monitors support 640x480 which is lower than our minimum supported resolution (800x600).
We should filter out resolutions that are smaller than 640x480.


OK, fixed in latest SVN.

Edward_Lii {l Wrote}: acme_pjz wrote:And we should use the sizable window under non-fullscreen mode...


That's a great idea, I assume upon resizing the game would receive an event from SDL?


Yes, we'll receive SDL_VIDEORESIZE event, but during gaming I'm not sure if we can recreate the bitmap :|

Re: screensize bugs

PostPosted: 03 May 2012, 07:31
by Edward_Lii
Hello acme_pjz,

acme_pjz {l Wrote}:OK, fixed in latest SVN.

Great work. :)

acme_pjz {l Wrote}:Yes, we'll receive SDL_VIDEORESIZE event, but during gaming I'm not sure if we can recreate the bitmap :|

What do you mean with bitmap, the background image?
I think the biggest problem is that when we change the resolution the GUIObjects will be placed wrongly.

Perhaps we should a resize() method to GameState and the let the screen implement the rearranging of the elements?

Re: screensize bugs

PostPosted: 03 May 2012, 07:41
by acme_pjz
Edward_Lii {l Wrote}:What do you mean with bitmap, the background image?


Yes, and some buffer surface created in createScreen() function...

Edward_Lii {l Wrote}:I think the biggest problem is that when we change the resolution the GUIObjects will be placed wrongly.

Perhaps we should a resize() method to GameState and the let the screen implement the rearranging of the elements?


Maybe. IMHO first try if dynamic resize window works, after that we add some GUI resize code...

BTW: Is OpenGL hardware acceleration usable?

Re: screensize bugs

PostPosted: 03 May 2012, 07:47
by Edward_Lii
Hello acme_pjz,

acme_pjz {l Wrote}:Maybe. IMHO first try if dynamic resize window works, after that we add some GUI resize code...

I think the best solution would be to only rearrange/scale when the user is done resizing.
This will probably be too hard to detect properly, but it prevents the tempSurface and screenSurface to scale every time.

acme_pjz {l Wrote}:BTW: Is OpenGL hardware acceleration usable?

Yes it's usable, it gives a nice performance boost.
Basically it just converts the screen Surface to a texture and puts it on a fullscreen quad, but it gives enough performance gain that it's worth it.

And I think it doesn't even require openGL 2.1. ;)

Re: screensize bugs

PostPosted: 03 May 2012, 07:57
by acme_pjz
The compiler complains about GL_BGRA undefined :|

[EDIT] Fixed in latest SVN.

Re: screensize bugs

PostPosted: 03 May 2012, 08:02
by Edward_Lii
Hello acme_pjz,

acme_pjz {l Wrote}:The compiler complains about GL_BGRA undefined :|

Strange, it should be in the GL library <GL/gl.h>.

There aren't any other problems?
Does GL_RGBA work instead of GL_BGRA?