Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "CL_Device.h"
- #include <CEGUI.h>
- #include <CEGUIDirect3D11Renderer.h>
- CL_Device *Device ;
- using namespace CEGUI ;
- LRESULT CALLBACK WndProc ( HWND hwnd , UINT Msg , WPARAM wParam , LPARAM lParam)
- {
- switch(Msg)
- {
- case WM_CLOSE:
- DestroyWindow ( hwnd );
- PostQuitMessage(0);
- break ;
- default:
- return DefWindowProc ( hwnd , Msg , wParam , lParam);
- }
- return 0 ;
- }
- int WINAPI wWinMain ( HINSTANCE hInst , HINSTANCE hPrev , LPWSTR lmcmdline , int nShowCmd )
- {
- RECT Rect ;
- ::DXGI_SWAP_CHAIN_DESC swp ;
- WNDCLASSEX Bel ;
- Bel.cbClsExtra = 0 ;
- Bel.cbSize = sizeof(Bel);
- Bel.cbWndExtra = 0 ;
- Bel.hbrBackground = (HBRUSH)(COLOR_WINDOW+12);
- Bel.hCursor = LoadCursor ( NULL , IDC_ARROW);
- Bel.hIcon = LoadIcon ( NULL , IDI_APPLICATION);
- Bel.hIconSm = LoadIcon ( NULL , IDI_APPLICATION);
- Bel.hInstance = hInst ;
- Bel.lpfnWndProc = WndProc ;
- Bel.lpszClassName = L"POIAF";
- Bel.lpszMenuName = NULL ;
- Bel.style = 0 ;
- RegisterClassEx (&Bel);
- HWND hwnd = CreateWindowEx ( 0 , L"POIAF" , L"TEST" , WS_OVERLAPPEDWINDOW , 0 , 0 , 650 , 650 , NULL , NULL , hInst , NULL);
- ZeroMemory(&swp , sizeof(DXGI_SWAP_CHAIN_DESC));
- ::DXGI_SAMPLE_DESC SD ;
- SD.Count = 1 ;
- SD.Quality = 0 ;
- ::ShowWindow ( hwnd , SW_SHOW);
- ::UpdateWindow ( hwnd );
- Buffer Buf ;
- Buf.Height = Buf.Width = 650 ;
- Buf.Count = 1 ;
- Buf.Format = DXGI_FORMAT_B8G8R8A8_UNORM ;
- Device = new CL_Device (hwnd, Buf , 0 , SD , true , ::DXGI_FORMAT_B8G8R8A8_UNORM);
- MSG Msg ;
- ZeroMemory(&Msg , sizeof(MSG));
- CEGUI::Direct3D11Renderer &myrender = CEGUI::Direct3D11Renderer::bootstrapSystem ( Device->Get_Device () , Device->Get_DeviceContext());
- CEGUI::SchemeManager::getSingleton().create( "TaharezLook.scheme" );
- System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
- WindowManager& wmgr = WindowManager::getSingleton();
- Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
- System::getSingleton().setGUISheet( myRoot );
- FrameWindow *fWnd = (FrameWindow*)wmgr.createWindow("TaharezLook/FrameWindow", "Demo Window");
- myRoot->setMousePassThroughEnabled(true);
- myRoot->addChildWindow( fWnd );
- fWnd->setText ( CEGUI::String() = "Bingo" );
- // position a quarter of the way in from the top-left of parent.
- fWnd->setPosition( UVector2( UDim( 0.25f, 0 ), UDim( 0.25f, 0 ) ) );
- // set size to be half the size of the parent
- fWnd->setSize( UVector2( UDim( 0.5f, 0 ), UDim( 0.5f, 0 ) ) );
- ::ShowCursor ( false );
- float Color [4] = { 0.0f , 0.0f , 0.0f , 0.5f };
- while ( Msg.message != WM_QUIT )
- {
- if ( ::PeekMessageA ( &Msg , NULL , 0U , 0U , PM_REMOVE))
- {
- ::TranslateMessage ( &Msg);
- ::DispatchMessageA ( &Msg);
- }
- else
- {
- Device->Get_DeviceContext()->ClearRenderTargetView ( Device->Get_Target() , Color );
- System::getSingleton().renderGUI();
- Device->Get_SwapChain()->Present ( 0 , 0 );
- }
- }
- Device->~CL_Device();
- ::UnregisterClass ( Bel.lpszClassName , Bel.hInstance);
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement