Advertisement

Looking for Information (DirectX)

Started by December 11, 2002 08:17 AM
2 comments, last by Turt99 21 years, 11 months ago
I''m just getting into directX, I''ve done some reading and some tutorials, but most of them seem to want to show how to make a Full Screen game, what I''m looking to do is create a Windowed game, I realize that this is going to be harder because you have control over the whole screen when you blit (please don''t insult me if that is wrong).. What I''m looking for is advice on where I should look for making a windowed directX game, right now I have the window, and I''m almost sure I got the primary surface, I''m thinking all I need to know now is how to link the 2 of them Any Information would be helpful Please visit Turt99 Productions
FOLLOW ME ON TWITTER OR MY BLOG
There is very little difference in doing something for windowed mode at least if you are just looking to setup something that can run both.

Here is the code I use

if (aWindowMode == WINDOWED_MODE)
{
D3DDISPLAYMODE mode;
//Get the current mode that we are using in windows
myD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &mode);

//Check that we have a good display mode (32 bit)
if (FAILED (CheckCurrentDisplayMode(&mode) ) )
{
return E_FAIL;
}

// Set up the structure used to create the D3DDevice. Since we are now
// using more complex geometry, we will create a device with a zbuffer.
d3dpp.BackBufferWidth = SCREEN_WIDTH;
d3dpp.BackBufferHeight = SCREEN_HEIGHT;
d3dpp.BackBufferFormat = mode.Format; //use the format from windows
d3dpp.BackBufferCount = 1;
d3dpp.EnableAutoDepthStencil = TRUE; //Enable Z-buffer
d3dpp.AutoDepthStencilFormat = D3DFMT_D16; //Make it 16 bit deep
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.Windowed = TRUE;
}
else
{
d3dpp.BackBufferWidth = SCREEN_WIDTH;
d3dpp.BackBufferHeight = SCREEN_HEIGHT;
d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8;
d3dpp.BackBufferCount = 1;
d3dpp.EnableAutoDepthStencil = TRUE; //Enable Z-buffer
d3dpp.AutoDepthStencilFormat = D3DFMT_D16; //Make it 16 bit deep
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
//d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.Windowed = FALSE;
}


I probably requires you to run 32 bit in windows. Maybe not
Advertisement
I haven't looked at these, but I would imagine they'd be a start:

Full screen to window Pt 1
Full screen to window Pt 2

Also try this - MFC and DirectX

[edited by - Machaira on December 11, 2002 9:50:53 AM]

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

Oops I guess I forgot to mention that I''m using DirectDraw and not Direct3D.. It might not my a big difference on how things would work but I''m pretty sure the code would look different..

I was looking at those tutorials that where mentioned and they seem to be what I''m looking for, however they are more for people that know what they are doing and what to just have a program that can switch.. maybe with extra research I can use those to figure it out...

also I''m going to look at nexe.gamedev.net, maybe there is something there as well

Please visit Turt99 Productions
FOLLOW ME ON TWITTER OR MY BLOG

This topic is closed to new replies.

Advertisement