25 Initialize(requiredMajor, requiredMinor, saveDriverInfo);
37 std::to_wstring(reinterpret_cast<uint64_t>(
this));
41 wc.lpfnWndProc = DefWindowProc;
44 wc.hInstance =
nullptr;
45 wc.hIcon = LoadIcon(0, IDI_APPLICATION);
46 wc.hCursor = LoadCursor(0, IDC_ARROW);
47 wc.hbrBackground =
static_cast<HBRUSH
>(GetStockObject(WHITE_BRUSH));
49 wc.lpszMenuName =
nullptr;
52 DWORD style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
53 RECT rect = { 0, 0, 15, 15 };
54 if (AdjustWindowRect(&rect, style, FALSE) != FALSE)
56 int xSize =
static_cast<int>(rect.right - rect.left + 1);
57 int ySize =
static_cast<int>(rect.bottom - rect.top + 1);
59 0, 0, xSize, ySize,
nullptr,
nullptr,
nullptr,
nullptr);
60 Initialize(requiredMajor, requiredMinor, saveDriverInfo);
106 mXSize =
static_cast<unsigned int>(rect.right - rect.left);
107 mYSize =
static_cast<unsigned int>(rect.bottom - rect.top);
110 PIXELFORMATDESCRIPTOR pfd;
111 memset(&pfd, 0,
sizeof(PIXELFORMATDESCRIPTOR));
112 pfd.nSize =
sizeof(PIXELFORMATDESCRIPTOR);
117 PFD_GENERIC_ACCELERATED |
121 pfd.iPixelType = PFD_TYPE_RGBA;
126 pfd.cStencilBits = 8;
129 int pixelFormat = ChoosePixelFormat(
mDevice, &pfd);
130 if (pixelFormat == 0)
132 LogError(
"ChoosePixelFormat failed.");
141 if (!SetPixelFormat(
mDevice, pixelFormat, &pfd))
156 LogError(
"wglCreateContext failed.");
193 wglMakeCurrent(
mDevice,
nullptr);
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
virtual void MakeActive() override
std::wstring mComputeWindowClass
virtual bool Initialize(int requiredMajor, int requiredMinor, bool saveDriverInfo) override
virtual void DisplayColorBuffer(unsigned int syncInterval) override
WGLEngine(HWND handle, bool saveDriverInfo, int requiredMajor=4, int requiredMinor=3)
#define LogError(message)
virtual bool IsActive() const override
int __stdcall wglSwapIntervalEXT(int interval)
virtual bool Initialize(int requiredMajor, int requiredMinor, bool saveDriverInfo)
typedef BOOL(WINAPI *PFNWGLSAVEBUFFERREGIONARBPROC)(HANDLE hRegion