Direct3D11 backend is slightly less broken

This commit is contained in:
UnknownShadow200 2021-09-23 08:54:05 +10:00
parent becee45794
commit f6abeb3423
4 changed files with 206 additions and 19 deletions

View file

@ -152,7 +152,7 @@ Thus it is **NOT SAFE** to allocate a string on the stack. */
#ifndef CC_BUILD_MANUAL
#if defined _WIN32
#define CC_BUILD_WIN
#define CC_BUILD_D3D9
#define CC_BUILD_D3D11
#define CC_BUILD_WINGUI
#define CC_BUILD_WININET
#define CC_BUILD_WINMM
@ -247,7 +247,7 @@ Thus it is **NOT SAFE** to allocate a string on the stack. */
#endif
#endif
#ifdef CC_BUILD_D3D9
#if defined CC_BUILD_D3D9 || defined CC_BUILD_D3D11
typedef void* GfxResourceID;
#else
/* Ensure size is same as D3D9, even though only 32 bits are used */

View file

@ -24,6 +24,44 @@ static IDXGIAdapter* dxgi_adapter;
static IDXGIFactory1* dxgi_factory;
static IDXGISwapChain* swapchain;
static ID3D11RenderTargetView* backbuffer;
static unsigned char vs_shader[1116];
static unsigned char ps_shader[776];
static ID3D11InputLayout* input_textured;
static void UpdateViewport(void) {
D3D11_VIEWPORT viewport = { 0 };
viewport.TopLeftX = 0;
viewport.TopLeftY = 0;
viewport.Width = WindowInfo.Width;
viewport.Height = WindowInfo.Height;
ID3D11DeviceContext_RSSetViewports(context, 1, &viewport);
}
static void AttachShaders(void) {
ID3D11VertexShader* vs;
HRESULT hr1 = ID3D11Device_CreateVertexShader(device, vs_shader, sizeof(vs_shader), NULL, &vs);
ID3D11PixelShader* ps;
HRESULT hr2 = ID3D11Device_CreatePixelShader(device, ps_shader, sizeof(ps_shader), NULL, &ps);
ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0);
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
Platform_LogConst("");
}
static void CreateInputLayouts(void) {
ID3D11InputLayout* input = NULL;
// https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-input-assembler-stage-getting-started
static D3D11_INPUT_ELEMENT_DESC T_layout[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR" , 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0, 20, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
HRESULT hr = ID3D11Device_CreateInputLayout(device, T_layout, Array_Elems(T_layout), vs_shader, sizeof(vs_shader), &input);
Platform_LogConst("");
input_textured = input;
}
void Gfx_Create(void) {
DXGI_SWAP_CHAIN_DESC desc = { 0 };
@ -59,13 +97,10 @@ void Gfx_Create(void) {
ID3D11Texture2D_Release(pBackBuffer);
ID3D11DeviceContext_OMSetRenderTargets(context, 1, &backbuffer, NULL);
D3D11_VIEWPORT viewport = { 0 };
viewport.TopLeftX = 0;
viewport.TopLeftY = 0;
viewport.Width = WindowInfo.Width;
viewport.Height = WindowInfo.Height;
ID3D11DeviceContext_RSSetViewports(context, 1, &viewport);
UpdateViewport();
ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TRIANGLE);
AttachShaders();
CreateInputLayouts();
}
cc_bool Gfx_TryRestoreContext(void) {
@ -194,15 +229,13 @@ void Gfx_SetDepthWrite(cc_bool enabled) {
*#########################################################################################################################*/
GfxResourceID Gfx_CreateIb(void* indices, int indicesCount) {
ID3D11Buffer* buffer = NULL;
D3D11_BUFFER_DESC desc;
D3D11_BUFFER_DESC desc = { 0 };
D3D11_SUBRESOURCE_DATA data;
HRESULT hr;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = sizeof(cc_uint16) * indicesCount;
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
desc.CPUAccessFlags = 0;
desc.MiscFlags = 0;
data.pSysMem = indices;
data.SysMemPitch = 0;
@ -230,11 +263,32 @@ void Gfx_DeleteIb(GfxResourceID* ib) {
/*########################################################################################################################*
*------------------------------------------------------Vertex buffers-----------------------------------------------------*
*#########################################################################################################################*/
static ID3D11Buffer* CreateVertexBuffer(VertexFormat fmt, int count, cc_bool dynamic) {
ID3D11Buffer* buffer = NULL;
D3D11_BUFFER_DESC desc = { 0 };
HRESULT hr;
desc.Usage = dynamic ? D3D11_USAGE_DYNAMIC : D3D11_USAGE_DEFAULT;
desc.CPUAccessFlags = dynamic ? D3D11_CPU_ACCESS_WRITE : 0;
desc.ByteWidth = count * strideSizes[fmt];
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
/* TODO set data initially */
hr = ID3D11Device_CreateBuffer(device, &desc, NULL, &buffer);
if (hr) Logger_Abort2(hr, "Failed to create index buffer");
return buffer;
}
GfxResourceID Gfx_CreateVb(VertexFormat fmt, int count) {
return 0;
/* TODO immutable? */
return CreateVertexBuffer(fmt, count, false);
}
void Gfx_BindVb(GfxResourceID vb) {
ID3D11Buffer* buffer = (ID3D11Buffer*)vb;
static UINT32 stride[] = { SIZEOF_VERTEX_TEXTURED };
static UINT32 offset[] = { 0 };
ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &buffer, stride, offset);
}
void Gfx_DeleteVb(GfxResourceID* vb) { }
@ -245,15 +299,20 @@ void* Gfx_LockVb(GfxResourceID vb, VertexFormat fmt, int count) {
}
void Gfx_UnlockVb(GfxResourceID vb) {
ID3D11Buffer* buffer = (ID3D11Buffer*)vb;
ID3D11DeviceContext_UpdateSubresource(context, buffer, 0, NULL, tmp, 0, 0);
Mem_Free(tmp);
tmp = NULL;
}
cc_bool render;
void Gfx_SetVertexFormat(VertexFormat fmt) {
render = fmt == VERTEX_FORMAT_TEXTURED;
ID3D11DeviceContext_IASetInputLayout(context, input_textured);
}
void Gfx_DrawVb_Lines(int verticesCount) {
if (!render) return;
// WARNING: IF YOU UNCOMMENT YOUR DISPLAY DRIVER MAY CRASH
// ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_LINE);
// ID3D11DeviceContext_Draw(context, verticesCount, 0);
@ -261,18 +320,21 @@ void Gfx_DrawVb_Lines(int verticesCount) {
}
void Gfx_DrawVb_IndexedTris(int verticesCount) {
if (!render) return;
// WARNING: IF YOU UNCOMMENT YOUR DISPLAY DRIVER MAY CRASH
// ID3D11DeviceContext_DrawIndexed(context, ICOUNT(verticesCount), 0, 0);
//ID3D11DeviceContext_DrawIndexed(context, ICOUNT(verticesCount), 0, 0);
}
void Gfx_DrawVb_IndexedTris_Range(int verticesCount, int startVertex) {
if (!render) return;
// WARNING: IF YOU UNCOMMENT YOUR DISPLAY DRIVER MAY CRASH
// ID3D11DeviceContext_DrawIndexed(context, ICOUNT(verticesCount), 0, startVertex);
}
void Gfx_DrawIndexedTris_T2fC4b(int verticesCount, int startVertex) {
if (!render) return;
// WARNING: IF YOU UNCOMMENT YOUR DISPLAY DRIVER MAY CRASH
// ID3D11DeviceContext_DrawIndexed(context, ICOUNT(verticesCount), 0, startVertex);
//ID3D11DeviceContext_DrawIndexed(context, ICOUNT(verticesCount), 0, startVertex);
}
@ -280,7 +342,7 @@ void Gfx_DrawIndexedTris_T2fC4b(int verticesCount, int startVertex) {
*--------------------------------------------------Dynamic vertex buffers-------------------------------------------------*
*#########################################################################################################################*/
GfxResourceID Gfx_CreateDynamicVb(VertexFormat fmt, int maxVertices) {
return 0;
return CreateVertexBuffer(fmt, maxVertices, true);
}
void* Gfx_LockDynamicVb(GfxResourceID vb, VertexFormat fmt, int count) {
@ -398,4 +460,129 @@ void Gfx_GetApiInfo(cc_string* info) {
void Gfx_OnWindowResize(void) {
}
static unsigned char vs_shader[1116] = {
0x44,0x58,0x42,0x43,0x5f,0xa2,0x47,0x00,0x48,0x03,0x98,0xc1,0xad,0xab,0xf4,0x6e,
0x25,0x61,0xe7,0x6c,0x01,0x00,0x00,0x00,0x5c,0x04,0x00,0x00,0x06,0x00,0x00,0x00,
0x38,0x00,0x00,0x00,0x18,0x01,0x00,0x00,0x30,0x02,0x00,0x00,0xac,0x02,0x00,0x00,
0x78,0x03,0x00,0x00,0xe8,0x03,0x00,0x00,0x41,0x6f,0x6e,0x39,0xd8,0x00,0x00,0x00,
0xd8,0x00,0x00,0x00,0x00,0x02,0xfe,0xff,0xa4,0x00,0x00,0x00,0x34,0x00,0x00,0x00,
0x01,0x00,0x24,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x24,0x00,
0x01,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x02,0xfe,0xff,0x1f,0x00,0x00,0x02,0x05,0x00,0x00,0x80,
0x00,0x00,0x0f,0x90,0x1f,0x00,0x00,0x02,0x05,0x00,0x01,0x80,0x01,0x00,0x0f,0x90,
0x1f,0x00,0x00,0x02,0x05,0x00,0x02,0x80,0x02,0x00,0x0f,0x90,0x08,0x00,0x00,0x03,
0x00,0x00,0x04,0xc0,0x00,0x00,0xe4,0x90,0x03,0x00,0xe4,0xa0,0x08,0x00,0x00,0x03,
0x00,0x00,0x01,0x80,0x00,0x00,0xe4,0x90,0x01,0x00,0xe4,0xa0,0x08,0x00,0x00,0x03,
0x00,0x00,0x02,0x80,0x00,0x00,0xe4,0x90,0x02,0x00,0xe4,0xa0,0x08,0x00,0x00,0x03,
0x00,0x00,0x04,0x80,0x00,0x00,0xe4,0x90,0x04,0x00,0xe4,0xa0,0x04,0x00,0x00,0x04,
0x00,0x00,0x03,0xc0,0x00,0x00,0xaa,0x80,0x00,0x00,0xe4,0xa0,0x00,0x00,0xe4,0x80,
0x01,0x00,0x00,0x02,0x00,0x00,0x08,0xc0,0x00,0x00,0xaa,0x80,0x01,0x00,0x00,0x02,
0x00,0x00,0x03,0xe0,0x01,0x00,0xe4,0x90,0x01,0x00,0x00,0x02,0x01,0x00,0x0f,0xe0,
0x02,0x00,0xe4,0x90,0xff,0xff,0x00,0x00,0x53,0x48,0x44,0x52,0x10,0x01,0x00,0x00,
0x40,0x00,0x01,0x00,0x44,0x00,0x00,0x00,0x59,0x00,0x00,0x04,0x46,0x8e,0x20,0x00,
0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x5f,0x00,0x00,0x03,0x72,0x10,0x10,0x00,
0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x03,0x32,0x10,0x10,0x00,0x01,0x00,0x00,0x00,
0x5f,0x00,0x00,0x03,0xf2,0x10,0x10,0x00,0x02,0x00,0x00,0x00,0x67,0x00,0x00,0x04,
0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x03,
0x32,0x20,0x10,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x03,0xf2,0x20,0x10,0x00,
0x02,0x00,0x00,0x00,0x10,0x00,0x00,0x08,0x12,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
0x46,0x12,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x82,0x20,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x08,0x22,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
0x46,0x12,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x82,0x20,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x08,0x42,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
0x46,0x12,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x82,0x20,0x00,0x00,0x00,0x00,0x00,
0x02,0x00,0x00,0x00,0x10,0x00,0x00,0x08,0x82,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
0x46,0x12,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x82,0x20,0x00,0x00,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x36,0x00,0x00,0x05,0x32,0x20,0x10,0x00,0x01,0x00,0x00,0x00,
0x46,0x10,0x10,0x00,0x01,0x00,0x00,0x00,0x36,0x00,0x00,0x05,0xf2,0x20,0x10,0x00,
0x02,0x00,0x00,0x00,0x46,0x1e,0x10,0x00,0x02,0x00,0x00,0x00,0x3e,0x00,0x00,0x01,
0x53,0x54,0x41,0x54,0x74,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x44,0x45,0x46,
0xc4,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x1c,0x00,0x00,0x00,0x00,0x04,0xfe,0xff,0x00,0x09,0x00,0x00,0x94,0x00,0x00,0x00,
0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x24,0x47,0x6c,0x6f,0x62,0x61,0x6c,0x73,0x00,0xab,0xab,0xab,0x3c,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,
0x02,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x76,0x70,0x4d,
0x61,0x74,0x72,0x69,0x78,0x00,0xab,0xab,0x03,0x00,0x03,0x00,0x04,0x00,0x04,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,
0x74,0x20,0x28,0x52,0x29,0x20,0x48,0x4c,0x53,0x4c,0x20,0x53,0x68,0x61,0x64,0x65,
0x72,0x20,0x43,0x6f,0x6d,0x70,0x69,0x6c,0x65,0x72,0x20,0x31,0x30,0x2e,0x30,0x2e,
0x31,0x30,0x30,0x31,0x31,0x2e,0x30,0x00,0x49,0x53,0x47,0x4e,0x68,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x00,0x00,
0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x0f,0x0f,0x00,0x00,
0x50,0x4f,0x53,0x49,0x54,0x49,0x4f,0x4e,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,
0x44,0x00,0x43,0x4f,0x4c,0x4f,0x52,0x00,0x4f,0x53,0x47,0x4e,0x6c,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
0x5c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x03,0x0c,0x00,0x00,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,
0x53,0x56,0x5f,0x50,0x4f,0x53,0x49,0x54,0x49,0x4f,0x4e,0x00,0x54,0x45,0x58,0x43,
0x4f,0x4f,0x52,0x44,0x00,0x43,0x4f,0x4c,0x4f,0x52,0x00,0xab
};
static unsigned char ps_shader[776] = {
0x44,0x58,0x42,0x43,0x80,0x7e,0xd1,0xfb,0x4c,0x12,0x28,0x91,0x8c,0xdc,0x0d,0xaa,
0x90,0x38,0x77,0x38,0x01,0x00,0x00,0x00,0x08,0x03,0x00,0x00,0x06,0x00,0x00,0x00,
0x38,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x5c,0x01,0x00,0x00,0xd8,0x01,0x00,0x00,
0x84,0x02,0x00,0x00,0xd4,0x02,0x00,0x00,0x41,0x6f,0x6e,0x39,0x80,0x00,0x00,0x00,
0x80,0x00,0x00,0x00,0x00,0x02,0xff,0xff,0x58,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
0x00,0x00,0x28,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x28,0x00,0x01,0x00,0x24,0x00,
0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0xff,0x1f,0x00,0x00,0x02,
0x00,0x00,0x00,0x80,0x00,0x00,0x03,0xb0,0x1f,0x00,0x00,0x02,0x00,0x00,0x00,0x80,
0x01,0x00,0x0f,0xb0,0x1f,0x00,0x00,0x02,0x00,0x00,0x00,0x90,0x00,0x08,0x0f,0xa0,
0x42,0x00,0x00,0x03,0x00,0x00,0x0f,0x80,0x00,0x00,0xe4,0xb0,0x00,0x08,0xe4,0xa0,
0x05,0x00,0x00,0x03,0x00,0x00,0x0f,0x80,0x00,0x00,0xe4,0x80,0x01,0x00,0xe4,0xb0,
0x01,0x00,0x00,0x02,0x00,0x08,0x0f,0x80,0x00,0x00,0xe4,0x80,0xff,0xff,0x00,0x00,
0x53,0x48,0x44,0x52,0x94,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x25,0x00,0x00,0x00,
0x5a,0x00,0x00,0x03,0x00,0x60,0x10,0x00,0x00,0x00,0x00,0x00,0x58,0x18,0x00,0x04,
0x00,0x70,0x10,0x00,0x00,0x00,0x00,0x00,0x55,0x55,0x00,0x00,0x62,0x10,0x00,0x03,
0x32,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x62,0x10,0x00,0x03,0xf2,0x10,0x10,0x00,
0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x03,0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,
0x68,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x45,0x00,0x00,0x09,0xf2,0x00,0x10,0x00,
0x00,0x00,0x00,0x00,0x46,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x7e,0x10,0x00,
0x00,0x00,0x00,0x00,0x00,0x60,0x10,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x07,
0xf2,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x46,0x0e,0x10,0x00,0x00,0x00,0x00,0x00,
0x46,0x1e,0x10,0x00,0x01,0x00,0x00,0x00,0x3e,0x00,0x00,0x01,0x53,0x54,0x41,0x54,
0x74,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0x44,0x45,0x46,0xa4,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,
0x00,0x04,0xff,0xff,0x00,0x09,0x00,0x00,0x74,0x00,0x00,0x00,0x5c,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,
0x02,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x67,0x5f,0x73,0x61,
0x6d,0x4c,0x69,0x6e,0x65,0x61,0x72,0x00,0x67,0x5f,0x74,0x78,0x44,0x69,0x66,0x66,
0x75,0x73,0x65,0x00,0x4d,0x69,0x63,0x72,0x6f,0x73,0x6f,0x66,0x74,0x20,0x28,0x52,
0x29,0x20,0x48,0x4c,0x53,0x4c,0x20,0x53,0x68,0x61,0x64,0x65,0x72,0x20,0x43,0x6f,
0x6d,0x70,0x69,0x6c,0x65,0x72,0x20,0x31,0x30,0x2e,0x30,0x2e,0x31,0x30,0x30,0x31,
0x31,0x2e,0x30,0x00,0x49,0x53,0x47,0x4e,0x48,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
0x08,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x41,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x0f,0x0f,0x00,0x00,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x00,0x43,0x4f,0x4c,
0x4f,0x52,0x00,0xab,0x4f,0x53,0x47,0x4e,0x2c,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x53,0x56,0x5f,0x54,
0x41,0x52,0x47,0x45,0x54,0x00,0xab,0xab
};
#endif

View file

@ -72,7 +72,7 @@ static void CreateD3D9Instance(void) {
cc_result res;
// still to check: managed texture perf, driver reset
// consider optimised CreateTexture??
if (Options_GetBool("gfx-direct3d9ex", false)) {
if (true || Options_GetBool("gfx-direct3d9ex", false)) {
res = _Direct3DCreate9Ex(D3D_SDK_VERSION, &d3d);
if (res == D3DERR_NOTAVAILABLE) {
/* Direct3D9Ex not supported, fallback to normal Direct3D9 */

View file

@ -74,8 +74,8 @@ static int RunProgram(int argc, char** argv) {
#ifdef _MSC_VER
/* NOTE: Make sure to comment this out before pushing a commit */
//cc_string rawArgs = String_FromConst("UnknownShadow200 fffff 127.0.0.1 25565");
//cc_string rawArgs = String_FromConst("UnknownShadow200");
//argsCount = String_UNSAFE_Split(&rawArgs, ' ', args, 4);
cc_string rawArgs = String_FromConst("UnknownShadow200");
argsCount = String_UNSAFE_Split(&rawArgs, ' ', args, 4);
#endif
if (argsCount == 0) {