Non-Standard Window Sizes?

Is it possible to create a window - it won’t be used in fullscreen mode -
that is NOT one of the resolutions supported by the video card, but will fit
on the current screen?

For example, a simple board game I’m working on currently is rendered at
350x350, All I need is a window big enough to hold this and a simple menu.
Is this possible, and if so, how would I do it? Trying to use
SetVideoMode(350, 350…) results in an error that DirectX has the wrong
pitch.

Thanks
Lonnie

try passing in 0 for bpp, this will give you the desktops current depth and
should work

“Lonnie Ezell” wrote in message
news:8tlc9l$24g$1 at ftp.lokigames.com

Is it possible to create a window - it won’t be used in fullscreen mode -
that is NOT one of the resolutions supported by the video card, but will
fit> on the current screen?

For example, a simple board game I’m working on currently is rendered at
350x350, All I need is a window big enough to hold this and a simple menu.
Is this possible, and if so, how would I do it? Trying to use
SetVideoMode(350, 350…) results in an error that DirectX has the wrong
pitch.

Thanks
Lonnie

Is it possible to create a window - it won’t be used in fullscreen mode -
that is NOT one of the resolutions supported by the video card, but will fit
on the current screen?

For example, a simple board game I’m working on currently is rendered at
350x350, All I need is a window big enough to hold this and a simple menu.
Is this possible, and if so, how would I do it? Trying to use
SetVideoMode(350, 350…) results in an error that DirectX has the wrong
pitch.

This is sort of a bug. You should be able to do this, but SDL is presuming
a particular alignment that DirectX is not providing and there is no way to
adjust the alignment since SDL is passing preallocated memory to DirectX.

The easiest workaround is just to open windows with widths of a multiple
of four. I’m open to suggestions as to real fixes for the problem.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

For example, a simple board game I’m working on currently is rendered at
350x350, All I need is a window big enough to hold this and a simple menu.
Is this possible, and if so, how would I do it? Trying to use
SetVideoMode(350, 350…) results in an error that DirectX has the wrong
pitch.

I just tried this at 8 and 16 bpp and it worked just fine on DirectX 7a
with a G400 video card. What version of DirectX and what kind of video
card are you using?

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

For example, a simple board game I’m working on currently is rendered at
350x350, All I need is a window big enough to hold this and a simple menu.
Is this possible, and if so, how would I do it? Trying to use
SetVideoMode(350, 350…) results in an error that DirectX has the wrong
pitch.

I was just able to reproduce this problem by switching from fullscreen
350x350 to windowed 350x350. I’ll see what I can do to fix it.

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

For example, a simple board game I’m working on currently is rendered at
350x350, All I need is a window big enough to hold this and a simple menu.
Is this possible, and if so, how would I do it? Trying to use
SetVideoMode(350, 350…) results in an error that DirectX has the wrong
pitch.

I have found and fixed the bug. I was using the old hardware pitch instead
of the new software surface pitch… in addition, I found and fixed a large
memory leak when switching video modes on Win32. The code will be in a CVS
snapshot available later today.

Thanks! :slight_smile:
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam,

Thanks for the work! It’s great to see this supported so much!

Sorry I didn’t get back sooner, my ISP had some problems…ain’t that
always the story!

Lonnie> ----- Original Message -----

From: slouken@devolution.com (Sam Lantinga)
Newsgroups: loki.open-source.sdl
Sent: Sunday, November 12, 2000 11:42 AM
Subject: Re: Non-Standard Window Sizes?

For example, a simple board game I’m working on currently is
rendered at

350x350, All I need is a window big enough to hold this and a simple
menu.

Is this possible, and if so, how would I do it? Trying to use
SetVideoMode(350, 350…) results in an error that DirectX has the
wrong

pitch.

I have found and fixed the bug. I was using the old hardware pitch
instead
of the new software surface pitch… in addition, I found and fixed a large
memory leak when switching video modes on Win32. The code will be in a
CVS
snapshot available later today.

Thanks! :slight_smile:
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam,

Thanks for the work! It’s great to see this supported so much!

My pleasure! Sometimes I can’t get to things quickly, but I do my best. :slight_smile:

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software