DR00ME Posted June 26, 2006 Posted June 26, 2006 ok, I got win32 application using directX... but of course I got a problem... I got Experimental3D.cpp, D3D.cpp and D3D.h the thing is that I would like to create a new D3D class object in Experimental3D.cpp but I don't know where or how... Experimental3D looks like this.... #include <windows.h> #include <d3d8.h> #include <tchar.h> #include "resource.h" #include "D3D.h" //HWND hwnd = (HWND)this->get_Handle().ToPointer(); yeah = new D3D(); <-- this is the problematic place... I would like to do like this but I cant... where should I create this object? D3D *yeah; // basic windows message procedure LRESULT CALLBACK frame_window_proc(HWND window, UINT msg, WPARAM wp, LPARAM lp) { LRESULT result = 0; if (WM_SIZING == msg || WM_PAINT == msg) { yeah->frame_draw(); // here I need to call function of D3D class } else { result = DefWindowProc(window, msg, wp, lp); } return result; } int __stdcall _tWinMain(HINSTANCE instance, HINSTANCE, LPTSTR, int) { const TCHAR *const APP_NAME = _T("Direct3D"); // Register the window class for the main window. { const WNDCLASS wc = { 0, frame_window_proc, 0, 0, instance, NULL, LoadCursor(NULL, IDC_CROSS), static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH)), NULL, APP_NAME }; if (!RegisterClass(&wc)) { return 1; } } yeah->init(instance); // here I need to pass instance for init return 0; } Any ideas? Quote "Everything should be made as simple as possible, but not simpler." "It's not that I'm so smart , it's just that I stay with problems longer ." - Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.