Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

FullScreen.

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 :)

Comments

  • pingpongpingpong Posts: 937Member
    Cant you just create a window that takes full screen? Somethine like:
    [code]
    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);
    [/code]
    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 :)
    :

  • xbobxbob Posts: 69Member

    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 :)



    [GRAY]
    : Cant you just create a window that takes full screen? Somethine like:
    : [code]
    : 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);
    : [/code]
    : 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 :)
    : :
    :
    :
    [/GRAY]
  • pingpongpingpong Posts: 937Member
    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 :)

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    : 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.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • pingpongpingpong Posts: 937Member
    : : 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.
  • xbobxbob Posts: 69Member
    [GRAY]
    : : : 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.
    :
    [/GRAY]
    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 :)
  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    : 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.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
    : 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!

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

Sign In or Register to comment.