Re: Directx10 Beginning!
Posted: Fri Oct 02, 2009 6:28 pm
It seems as though resource.h doesn't exist. Are you sure it's in your project's solution?
The Next Generation of 2D Roleplaying Games
http://elysianshadows.com/phpBB3/
Since you didn't create "resource.h" and it's shown with quotes, you can probably remove it. I believe their supplied code assumes you are compiling their project complete with resources, or have some default resource file with a header already in your project template.EvolutionXEngine wrote:Code: Select all
#include "resource.h"
Code: Select all
#include <windows.h>
LRESULT CALLBACK MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
//
// Windows Main Entry Point
//
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR lpCmdLine, INT nCmdShow)
{
// Initialize COM
CoInitializeEx(NULL, COINIT_MULTITHREADED);
// Application instance handle
//HINSTANCE hInstance = hInst;
// Register the window class
WNDCLASSEX wc;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = MsgProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.lpszClassName = L"DirectX Application";
wc.hInstance = hInst;
RegisterClassEx( &wc );
// Create the application's window
HWND g_hWnd = CreateWindowW( wc.lpszClassName, TEXT("DirectX Application"),
WS_EX_TOPMOST | WS_POPUP, 200, 200, 600, 200,
NULL, NULL, wc.hInstance, NULL );
// Show the window
ShowWindow(g_hWnd, nCmdShow);
UpdateWindow(g_hWnd);
// Initialize DirectX and run your application here (minimal do-nothing code supplied)
int status = S_OK;
MSG msg;
msg.message = WM_NULL;
while (msg.message != WM_QUIT)
{
if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
// Game timers, logic and drawing
}
}
// Unregister the window class
UnregisterClass( wc.lpszClassName, wc.hInstance );
// Release COM
CoUninitialize();
return status;
}
//
// Windows Message Processor
//
LRESULT CALLBACK MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY:
{
PostQuitMessage( 0 );
return 0;
}
case WM_KEYDOWN:
{
if (wParam == VK_ESCAPE)
DestroyWindow(hWnd);
return 0;
}
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
hmm, think of it as a brain.EvolutionXEngine wrote:OMG i got it to work .. you guys where right .. I didn't know what was Projects/Solutions.. to open Tutorial00.cpp i first had to open Project Tutorial00.(something lol) and then execute.. My heart started pumping fast and that "window" made my day.. Thanks Guys .. Im going to continue reading my book!
By the way. do you know about a good tutorial about sending MSG <--- or something like that.. Would the analogy be like real life mail sending and receiving or data packets being send in a network? Sorry if i confused you.. lol
This is where I started my Win32 API learning: http://winprog.org/tutorial/start.htmlEvolutionXEngine wrote:OMG i got it to work .. you guys where right .. I didn't know what was Projects/Solutions.. to open Tutorial00.cpp i first had to open Project Tutorial00.(something lol) and then execute.. My heart started pumping fast and that "window" made my day.. Thanks Guys .. Im going to continue reading my book!
By the way. do you know about a good tutorial about sending MSG <--- or something like that.. Would the analogy be like real life mail sending and receiving or data packets being send in a network? Sorry if i confused you.. lol