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



Hi,

Thanks for helping me out again! Sorry, I had your tutorials on my
computer, but it looks like the ones I had were very old, so I downloaded
the newer ones again. But I'm still having a little trouble with the
graphics. I've managed to open a window, set the size to 320x200, without
a maximize button. Now, I still have two things I need to know: 1. How can
I make the window of a fixed size (so that the user can't make it
bigger/smaller than 320x200)? 2. How do I actually get a pixel in this
window? I looked at your tutorial on painting, but I don't need a shape or
anything, just a simple pixel, how would I do that?

Thanks for the help!!!

Caio,

Lionel

On Mon, 25 Sep 2000, Ben Humphrey wrote:

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

=================================================================
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