/* date = May 27th 2022 8:29 pm */

#ifndef D3D11_SYS_H
#define D3D11_SYS_H

////////////////////////////////
// NOTE(allen): D3D11 Types

typedef struct W32_D3D11Globals{
  HMODULE dxgi;
  HMODULE d3d11;
  HMODULE d3dcompiler;
  
  ID3D11Device        *device;
  ID3D11DeviceContext *ctx;
  ID3D11Debug         *dbg;
} W32_D3D11Globals;

typedef struct W32_D3D11Window{
  IDXGISwapChain *swap_chain;
} W32_D3D11Window;


////////////////////////////////
// NOTE(allen): D3D11 Globals

global W32_D3D11Globals w32_d3d11 = {0};


////////////////////////////////
// NOTE(allen): System D3D11 Functions

link_function B32 d3d11_init(void);

link_function B32 d3d11_equip_window(GFX_Window *w);

link_function ID3D11RenderTargetView*d3d11_begin_render(GFX_Window *w);
link_function void d3d11_end_render(ID3D11RenderTargetView *view);

link_function W32_D3D11Window* d3d11_window_from_gfx_window(GFX_Window *w);

#endif //D3D11S_SYS_H
