http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

TheGrumpyProgrammer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Windowed graphics in Windows



Lionel, if you go to my site www.GameTutorials.com you can find some basic
tutorials on windows.

To change the resolution do this:

void ChangeToFullScreen()
{
     DEVMODE dmSettings;         // Device Mode

     memset(&dmSettings,0,sizeof(dmSettings));   // Makes Sure Memory's
Cleared
     dmSettings.dmSize=sizeof(dmSettings);    // Size Of The Devmode
Structure
     dmSettings.dmPelsWidth = SCREEN_WIDTH;    // Selected Screen Width
     dmSettings.dmPelsHeight = SCREEN_HEIGHT;   // Selected Screen Height
     dmSettings.dmBitsPerPel = SCREEN_DEPTH;    // Selected Bits Per Pixel
     dmSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;

     ChangeDisplaySettings(&dmSettings,CDS_FULLSCREEN); // CDS_FULLSCREEN
Gets Rid Of Start Bar.
}

This is for Win32 Programming.

BUT after you close your program, be sure to set the stuff back by doing
this:

ChangeDisplaySettings(NULL,0);    // This reset the screen to it's original
settings

If you don't do this, they will have to restart or go to their propertys to
change the screen.
I have unsubscribed to this list for a time being, i am teaching a C++ class
at the college
so I can't afford ALL these emails coming in.  Write me if you need more
help.


Good Luck!

Ben Humphrey
Game Programmer
WebHost of www.GameTutorials.com
benh@humongous.com
benjina@mindspring.com

----- Original Message -----
From: Lionel Pinkhard <lionelp@worldonline.co.za>
To: <gameprogrammer@gameprogrammer.com>
Sent: Tuesday, January 01, 1980 12:25 PM
Subject: Windowed graphics in Windows


> Hey,
>
> I've recently started programming Windows, after a few years of Dos and
> Linux programming. At the moment, I can only code the console, and I would
> like to start working with windows. Firstly, I would like to know -- How
> do I create a window of a certain resolution? And how do I put simple
> pixels into this window? My first attempt at programming Windows, is to
> port a simple Dos game to Windows, without DirectX or any other special
> tools (I still need to download DirectX anyway :-) ). I think my questions
> are pretty clear, so I hope somebody can help me!
>
> Caio,
>
> Lionel
>
> =================================================================
> The GameProgrammer.Com mailing list is for the open discussion
> of any topic related to the art, science, and business of
> programming games. This list is especially tolerant of beginners.
> We were all beginners once
>
> To SUBSCRIBE or UNSUBSCRIBE please visit:
> http://gameprogrammer.com/mailinglist.html
>

=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html