Files
lity3d/Engine/Rendering/graphics_device.h
T
shuiyu1123 0669d102ce feat: major engine overhaul - scene demo with lighting, sphere, ground
- Scene Demo: cube + sphere + ground plane with proper lighting
- Audio: XAudio2 dynamic loading + WAV playback
- Physics: expanded collision system
- Renderer: improved pipeline with materials
- UI: extended widget system
- VisualScript: enhanced serializer + block interactions
- ASM: optimized math/memory/profiling routines
- Window: mouse input + scroll support
2026-07-12 08:21:07 +08:00

26 lines
880 B
C

#pragma once
#include <d3d11.h>
#include <dxgi.h>
#include <stdint.h>
typedef struct GraphicsDevice GraphicsDevice;
struct GraphicsDevice {
ID3D11Device* device;
ID3D11DeviceContext* context;
IDXGISwapChain* swap_chain;
ID3D11RenderTargetView* render_target;
ID3D11DepthStencilView* depth_stencil;
ID3D11Texture2D* depth_texture;
uint32_t width;
uint32_t height;
int vsync;
};
GraphicsDevice* graphics_device_create(void);
void graphics_device_destroy(GraphicsDevice* d);
int graphics_device_init(GraphicsDevice* d, void* hwnd, uint32_t w, uint32_t h, int vsync);
void graphics_device_resize(GraphicsDevice* d, uint32_t w, uint32_t h);
void graphics_device_clear(GraphicsDevice* d, float r, float g, float b, float a);
void graphics_device_present(GraphicsDevice* d);
int graphics_device_save_screenshot(GraphicsDevice* d, const char* path);