mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
Fixes to npc trade, begin native directx support
This commit is contained in:
@@ -204,6 +204,26 @@ void WIN32Window::init()
|
||||
{
|
||||
m_instance = GetModuleHandle(NULL);
|
||||
|
||||
#ifdef DIRECTX
|
||||
m_d3d = Direct3DCreate9(D3D_SDK_VERSION); // create the Direct3D interface
|
||||
|
||||
D3DPRESENT_PARAMETERS d3dpp; // create a struct to hold various device information
|
||||
|
||||
ZeroMemory(&d3dpp, sizeof(d3dpp)); // clear out the struct for use
|
||||
d3dpp.Windowed = TRUE; // program windowed, not fullscreen
|
||||
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; // discard old frames
|
||||
d3dpp.hDeviceWindow = m_window; // set the window to be used by Direct3D
|
||||
|
||||
// create a device class using this information and information from the d3dpp stuct
|
||||
m_d3d->CreateDevice(D3DADAPTER_DEFAULT,
|
||||
D3DDEVTYPE_HAL,
|
||||
m_window,
|
||||
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
|
||||
&d3dpp,
|
||||
&m_d3ddev);
|
||||
|
||||
#endif
|
||||
|
||||
internalCreateWindow();
|
||||
internalCreateGLContext();
|
||||
internalRestoreGLContext();
|
||||
|
@@ -31,6 +31,10 @@
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
|
||||
#ifdef DIRECTX
|
||||
#include <d3d9.h>
|
||||
#endif
|
||||
|
||||
struct WindowProcProxy;
|
||||
|
||||
class WIN32Window : public PlatformWindow
|
||||
@@ -95,6 +99,11 @@ private:
|
||||
HCURSOR m_defaultCursor;
|
||||
bool m_hidden;
|
||||
|
||||
#ifdef DIRECTX
|
||||
LPDIRECT3D9 m_d3d; // the pointer to our Direct3D interface
|
||||
LPDIRECT3DDEVICE9 m_d3ddev; // the pointer to the device class
|
||||
#endif
|
||||
|
||||
#ifdef OPENGL_ES
|
||||
EGLConfig m_eglConfig;
|
||||
EGLContext m_eglContext;
|
||||
|
Reference in New Issue
Block a user