Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

gs384

No Window Please

This topic is 5278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you get a lovely blank screen ,black or blue any colour will do, without a MS Window being anywhere in sight. All I want is a blank canvas on which to paint my dream. A link to a tutorial would be great and appreciated. Keepers of the flame never let it die

Share this post


Link to post
Share on other sites
Advertisement
Hiya.

If you already have a windowed version running its very easy to switch to full screen. Essentialy all you have to do is set the D3DPRESENT_PARAMETERS during initialisation so it knows its supposed to be full screen. eg if D3DParams is your instance of the D3DPRESENT_PARAMETERS then:

D3DParams.Windowed = false;

Also the windows code will have to be modified slightly. When you create your window (using CreateWindowEx() I assume) set the following flags:

WS_POPUP | WS_VISIBLE

For a tutorial try looking at:

http://www.codesampler.com/dx9src.htm

Hope this helps

Share this post


Link to post
Share on other sites
Thanks for the quick response motorherp; i''ll check out the link straight away

Keepers of the flame never let it die

Share this post


Link to post
Share on other sites
Can you please explain further?

"all you have to do is set the D3DPRESENT_PARAMETERS during initialisation so it knows its supposed to be full screen. eg if D3DParams is your instance of the D3DPRESENT_PARAMETERS then:

D3DParams.Windowed = false;
////////////////////////////////////

Here is how my window has been created but No sign of D3DParams in this code.

#include <windows.h>

const char *ClsName = "BasicApp";
const char *WndName = "GS384''s Window";

LRESULT CALLBACK WndProcedure(HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam);

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG Msg;
HWND hWnd;
WNDCLASSEX WndClsEx;

// Create the application window
WndClsEx.cbSize = sizeof(WNDCLASSEX);
WndClsEx.style = CS_HREDRAW | CS_VREDRAW;
WndClsEx.lpfnWndProc = WndProcedure;
WndClsEx.cbClsExtra = 0;
WndClsEx.cbWndExtra = 0;
WndClsEx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClsEx.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClsEx.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
WndClsEx.lpszMenuName = NULL;
WndClsEx.lpszClassName = ClsName;
WndClsEx.hInstance = hInstance;
WndClsEx.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

// Register the application
RegisterClassEx(&WndClsEx);

// Create the window object
hWnd = CreateWindow(ClsName,
WndName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);

// Find out if the window was created
if( !hWnd ) // If the window was not created,
return 0; // stop the application

// Display the window to the user
ShowWindow(hWnd, SW_SHOWNORMAL);
UpdateWindow(hWnd);

// Decode and treat the messages
// as long as the application is running
while( GetMessage(&Msg, NULL, 0, 0) )
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}

return Msg.wParam;
}

LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,
WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
// If the user wants to close the application
case WM_DESTROY:
// then close it
PostQuitMessage(WM_QUIT);
break;
default:
// Process the left-over messages
return DefWindowProc(hWnd, Msg, wParam, lParam);
}
// If something was not done, let it go
return 0;
}


Share this post


Link to post
Share on other sites

#include <windows.h>

const char *ClsName = "BasicApp";
const char *WndName = "GS384's Window";

LRESULT CALLBACK WndProcedure(HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam);

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG Msg;
HWND hWnd;
WNDCLASSEX WndClsEx;

// Create the application window

WndClsEx.cbSize = sizeof(WNDCLASSEX);
WndClsEx.style = CS_HREDRAW | CS_VREDRAW;
WndClsEx.lpfnWndProc = WndProcedure;
WndClsEx.cbClsExtra = 0;
WndClsEx.cbWndExtra = 0;
WndClsEx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClsEx.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClsEx.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
WndClsEx.lpszMenuName = NULL;
WndClsEx.lpszClassName = ClsName;
WndClsEx.hInstance = hInstance;
WndClsEx.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

// Register the application

RegisterClassEx(&WndClsEx);

// Create the window object

hWnd = CreateWindow(ClsName,
WndName,
WS_OVERLAPPEDWINDOW | WS_POPUP | WS_VISIBLE, //heres where it goes into fullscreen

CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);

// Find out if the window was created

if( !hWnd ) // If the window was not created,

return 0; // stop the application


// Display the window to the user

ShowWindow(hWnd, SW_SHOWNORMAL);
UpdateWindow(hWnd);

// Decode and treat the messages

// as long as the application is running

while( GetMessage(&Msg, NULL, 0, 0) )
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}

return Msg.wParam;
}

LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,
WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
// If the user wants to close the application

case WM_DESTROY:
// then close it

PostQuitMessage(WM_QUIT);
break;
default:
// Process the left-over messages

return DefWindowProc(hWnd, Msg, wParam, lParam);
}
// If something was not done, let it go

return 0;
}


though youll need to resize the window if youre not using DX or OpenGL to the current screen resolution

[edited by - redrabbit on June 6, 2004 2:24:05 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!