Quote:Original post by bobofjoe
Hit "continue" to allow the first chance exception to propagate to your exception handler.
Alright the error returned is "No such operator defined" but I know I defined the class. Here is the source for the class:
class E_WINDOW{public: E_WINDOW( E_WINDOW_DESC desc ) { WNDCLASSEX wcex; ZeroMemory( &wcex, sizeof( wcex ) ); wcex.cbSize = sizeof( WNDCLASSEX ); wcex.lpfnWndProc = WndProc; wcex.hIcon = (HICON)LoadImage( NULL, desc.icon.c_str(), IMAGE_ICON, 0, 0, LR_LOADFROMFILE ); wcex.hCursor = LoadCursor( NULL, IDC_ARROW ); wcex.lpszClassName = desc.name.c_str(); RegisterClassEx( &wcex ); DWORD style = (WS_SYSMENU * (desc.minimize | desc.maximize | desc.close)) | (WS_MINIMIZEBOX * desc.minimize) | (WS_MAXIMIZEBOX * desc.maximize) | (WS_SIZEBOX * desc.sizeable) | WS_EX_NOPARENTNOTIFY; hWnd = CreateWindow( desc.name.c_str(), desc.name.c_str(), style, desc.left, desc.top, desc.width, desc.height, NULL, NULL, NULL, NULL ); UnregisterClass( desc.name.c_str(), NULL ); ShowWindow( hWnd, SW_SHOW ); SwapChain = NULL; RenderTargetView = NULL; DepthStencilView = NULL; RECT WindowRect; GetWindowRect( hWnd, &WindowRect ); DXGI_SWAP_CHAIN_DESC sd; ZeroMemory( &sd, sizeof( sd ) ); sd.BufferCount = 1; sd.BufferDesc.Width = WindowRect.right - WindowRect.left; sd.BufferDesc.Height = WindowRect.bottom - WindowRect.top; sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; sd.BufferDesc.RefreshRate.Numerator = 60; sd.BufferDesc.RefreshRate.Denominator = 1; sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; sd.OutputWindow = hWnd; sd.SampleDesc.Count = 1; sd.SampleDesc.Quality = 0; sd.Windowed = true; sd.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH; IDXGIFactory * pFactory; CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&pFactory) ); pFactory->CreateSwapChain( g_d3dDevice, &sd, &SwapChain); pFactory->Release(); ID3D10Texture2D* pBackBuffer; SwapChain->GetBuffer( 0, __uuidof( ID3D10Texture2D ), ( LPVOID* )&pBackBuffer ); g_d3dDevice->CreateRenderTargetView( pBackBuffer, NULL, &RenderTargetView ); pBackBuffer->Release(); ID3D10Texture2D* DepthStencil; D3D10_TEXTURE2D_DESC DepthStencilDesc; DepthStencilDesc.Width = WindowRect.right - WindowRect.left; DepthStencilDesc.Height = WindowRect.bottom - WindowRect.top; DepthStencilDesc.MipLevels = 1; DepthStencilDesc.ArraySize = 1; DepthStencilDesc.Format = DXGI_FORMAT_D32_FLOAT; DepthStencilDesc.SampleDesc.Count = 1; DepthStencilDesc.SampleDesc.Quality = 0; DepthStencilDesc.Usage = D3D10_USAGE_DEFAULT; DepthStencilDesc.BindFlags = D3D10_BIND_DEPTH_STENCIL; DepthStencilDesc.CPUAccessFlags = 0; DepthStencilDesc.MiscFlags = 0; g_d3dDevice->CreateTexture2D( &DepthStencilDesc, NULL, &DepthStencil ); g_d3dDevice->CreateDepthStencilView( DepthStencil, NULL, &DepthStencilView ); DepthStencil->Release(); g_Windows.push_back( this ); } void Release() { SwapChain->Release(); RenderTargetView->Release(); DepthStencilView->Release(); } HWND hWnd; IDXGISwapChain* SwapChain; ID3D10RenderTargetView* RenderTargetView; ID3D10DepthStencilView* DepthStencilView;};
And here is where I define it in luabind:
luabind::module(g_Lua) [ luabind::class_<E_WINDOW>("Window") .def(luabind::constructor<E_WINDOW_DESC>()) ];
Remember Codeka is my alternate account, just remember that!