Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
FullScreen. Posted by xbob on 16 Nov 2003 at 10:47 AM
Hi people,

I have tried to change the screen resolution by calling ChangeDisplaySettings (DC function in GDI). This function, however, simply changes the resolution in Windows and does not switch to "full-screen mode" (like Borland BGIs do when calling "start_graph").

Anyway, does somebody know an easy/common way (without OpenGL or DirectX) to open a full-screen (from which an HDC can be obtain)?

Thanks in advance :)
Report
Re: FullScreen. Posted by pingpong on 17 Nov 2003 at 5:34 AM
Cant you just create a window that takes full screen? Somethine like:
int cx = GetSystemMetrics(SM_CXSCREEN);
int cy = GetSystemMetrics(SM_CYSCREEN);
hWnd = CreateWindowEx(
   0,
   "your class name",
   "your title",
   WS_POPUP,
   0,
   0,
   cx,
   cy,
   NULL,
   NULL,
   hInstance,
   NULL);

WS_POPUP so your window has no caption and no border.

: Hi people,
:
: I have tried to change the screen resolution by calling ChangeDisplaySettings (DC function in GDI). This function, however, simply changes the resolution in Windows and does not switch to "full-screen mode" (like Borland BGIs do when calling "start_graph").
:
: Anyway, does somebody know an easy/common way (without OpenGL or DirectX) to open a full-screen (from which an HDC can be obtain)?
:
: Thanks in advance :)
:

Report
Re: FullScreen. Posted by xbob on 17 Nov 2003 at 8:15 AM

That is actually what I am doing at the moment (combined with altering the screen resolution).

However, when using this approach, the desktop, clock etc. are still drawn in the background which affects the performance.

Most games, for example, use a "pure" full-screen where Windows gives the program all control of the display; that's what I am looking for.

Thanks for your reply, though :)




: Cant you just create a window that takes full screen? Somethine like:
:
: int cx = GetSystemMetrics(SM_CXSCREEN);
: int cy = GetSystemMetrics(SM_CYSCREEN);
: hWnd = CreateWindowEx(
:    0,
:    "your class name",
:    "your title",
:    WS_POPUP,
:    0,
:    0,
:    cx,
:    cy,
:    NULL,
:    NULL,
:    hInstance,
:    NULL);
: 

: WS_POPUP so your window has no caption and no border.
:
: : Hi people,
: :
: : I have tried to change the screen resolution by calling ChangeDisplaySettings (DC function in GDI). This function, however, simply changes the resolution in Windows and does not switch to "full-screen mode" (like Borland BGIs do when calling "start_graph").
: :
: : Anyway, does somebody know an easy/common way (without OpenGL or DirectX) to open a full-screen (from which an HDC can be obtain)?
: :
: : Thanks in advance :)
: :
:
:

Report
Re: FullScreen. Posted by pingpong on 17 Nov 2003 at 9:31 AM
Ah, then you have to use DirectX. I know you said you didnt want to use that but thats the only way to do it in Windows.

:
: That is actually what I am doing at the moment (combined with altering the screen resolution).
:
: However, when using this approach, the desktop, clock etc. are still drawn in the background which affects the performance.
:
: Most games, for example, use a "pure" full-screen where Windows gives the program all control of the display; that's what I am looking for.
:
: Thanks for your reply, though :)

Report
Re: FullScreen. Posted by Sephiroth on 18 Nov 2003 at 11:25 AM
: Ah, then you have to use DirectX. I know you said you didnt want to use that but thats the only way to do it in Windows.
:
HEY! He could also use the much easier to learn GL for that :D! However, it can be done without using either D3D or GL, it'd just take about a thousand lines of home-brew code.

-Sephiroth

Report
Re: FullScreen. Posted by pingpong on 18 Nov 2003 at 3:32 PM
: : Ah, then you have to use DirectX. I know you said you didnt want to use that but thats the only way to do it in Windows.
: :
: HEY! He could also use the much easier to learn GL for that :D! However, it can be done without using either D3D or GL, it'd just take about a thousand lines of home-brew code.
:

I think he's talking 2D graphics, so DirectDraw of DirectX is perfect. Dont think OpenGL has an equavalant for that, does it? Unless you draw everything as a texture but who wants to do that...

Also, can you do full screen with OpenGL? It's been years since I touched this stuff.
Report
Re: FullScreen. Posted by xbob on 19 Nov 2003 at 8:41 AM

: : : Ah, then you have to use DirectX. I know you said you didnt want to use that but thats the only way to do it in Windows.
: : :
: : HEY! He could also use the much easier to learn GL for that :D! However, it can be done without using either D3D or GL, it'd just take about a thousand lines of home-brew code.
: :
:
: I think he's talking 2D graphics, so DirectDraw of DirectX is perfect. Dont think OpenGL has an equavalant for that, does it? Unless you draw everything as a texture but who wants to do that...
:
: Also, can you do full screen with OpenGL? It's been years since I touched this stuff.
:

First of all; it is indeed possible to switch to full-screen without using either OpenGL or DirectX (as a matter of fact, all it requires is a single 0x10 bios interrupt). Also, when using some versions of Borland, BGI files are provided that support full-screen mode.

Second, the reason I wrote "without using OpenGL or DirectX" was because I am looking for a standard Windows method (ie. one that doesn't require DX or an OGL compatible gfx-card) provided by the GDI/WinAPI to ensure that an HDC can be provided.

Third, as a matter of fact, I was thinking 3D since I need a full-screen to test an engine I am working on.

Fourth, taking all the games that use OGL into consideration, I believe it is quit possible to create a full-screen apps using those tools.

Thanks for your replies anyway, though :)
Report
Re: FullScreen. Posted by Sephiroth on 19 Nov 2003 at 1:16 PM
: Second, the reason I wrote "without using OpenGL or DirectX" was because I am looking for a standard Windows method (ie. one that doesn't require DX or an OGL compatible gfx-card) provided by the GDI/WinAPI to ensure that an HDC can be provided.

No problem, but a card only has to be "GL-compatible". DirectX is slower for a reason. If your video card doesn't support certain hardware functions, DX can run them in software (through your CPU) and then send that data to the card for drawing. So DX will work on virtually every audio and video card in existance. Who wants to help me take the video card out fo my Atari400 and prove this? LOL!

-Sephiroth

Report
Re: FullScreen. Posted by Sephiroth on 19 Nov 2003 at 1:13 PM
: I think he's talking 2D graphics, so DirectDraw of DirectX is perfect. Dont think OpenGL has an equavalant for that, does it? Unless you draw everything as a texture but who wants to do that...
:
: Also, can you do full screen with OpenGL? It's been years since I touched this stuff.
:
AAAAAAAAUUUUUUUUUGGGGGGGGHHHHHHHHHHHHHHHH!!!!!!!!!!!!

Dude, look at the Unreal Engine, RTCW, Quake III, etc. They all have GL modes. Of course GL goes fullscreen. And you can easily pop 2D graphics onto the screen using the Ortho stuff. It's how I draw my HUD in my game.

However, I think he would have better luck with DDraw as you stated. Not onyl that, but with DirectX you have virtually no compatibility issues that ATI and Matrox cards have with GL due to not being 100% GL-compliant. So yeah, DirectX is probably best here.

-Sephiroth




 

Recent Jobs