|
|
|
@@ -443,7 +443,7 @@ const char *device_preprocessor_name(void)
|
|
|
|
|
return "_D3D11";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int device_create(gs_device_t *p_device, gs_init_data *data)
|
|
|
|
|
int device_create(gs_device_t **p_device, gs_init_data *data)
|
|
|
|
|
{
|
|
|
|
|
gs_device *device = NULL;
|
|
|
|
|
int errorcode = GS_SUCCESS;
|
|
|
|
@@ -466,24 +466,24 @@ int device_create(gs_device_t *p_device, gs_init_data *data)
|
|
|
|
|
return errorcode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_destroy(gs_device_t device)
|
|
|
|
|
void device_destroy(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
delete device;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_enter_context(gs_device_t device)
|
|
|
|
|
void device_enter_context(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
/* does nothing */
|
|
|
|
|
UNUSED_PARAMETER(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_leave_context(gs_device_t device)
|
|
|
|
|
void device_leave_context(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
/* does nothing */
|
|
|
|
|
UNUSED_PARAMETER(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_swapchain_t device_swapchain_create(gs_device_t device,
|
|
|
|
|
gs_swapchain_t *device_swapchain_create(gs_device_t *device,
|
|
|
|
|
struct gs_init_data *data)
|
|
|
|
|
{
|
|
|
|
|
gs_swap_chain *swap = NULL;
|
|
|
|
@@ -498,7 +498,7 @@ gs_swapchain_t device_swapchain_create(gs_device_t device,
|
|
|
|
|
return swap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_resize(gs_device_t device, uint32_t cx, uint32_t cy)
|
|
|
|
|
void device_resize(gs_device_t *device, uint32_t cx, uint32_t cy)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
ID3D11RenderTargetView *renderView = NULL;
|
|
|
|
@@ -520,23 +520,23 @@ void device_resize(gs_device_t device, uint32_t cx, uint32_t cy)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_get_size(gs_device_t device, uint32_t *cx, uint32_t *cy)
|
|
|
|
|
void device_get_size(gs_device_t *device, uint32_t *cx, uint32_t *cy)
|
|
|
|
|
{
|
|
|
|
|
*cx = device->curSwapChain->target.width;
|
|
|
|
|
*cy = device->curSwapChain->target.height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t device_get_width(gs_device_t device)
|
|
|
|
|
uint32_t device_get_width(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
return device->curSwapChain->target.width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t device_get_height(gs_device_t device)
|
|
|
|
|
uint32_t device_get_height(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
return device->curSwapChain->target.height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_texture_t device_texture_create(gs_device_t device, uint32_t width,
|
|
|
|
|
gs_texture_t *device_texture_create(gs_device_t *device, uint32_t width,
|
|
|
|
|
uint32_t height, enum gs_color_format color_format,
|
|
|
|
|
uint32_t levels, const uint8_t **data, uint32_t flags)
|
|
|
|
|
{
|
|
|
|
@@ -555,7 +555,7 @@ gs_texture_t device_texture_create(gs_device_t device, uint32_t width,
|
|
|
|
|
return texture;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_texture_t device_cubetexture_create(gs_device_t device, uint32_t size,
|
|
|
|
|
gs_texture_t *device_cubetexture_create(gs_device_t *device, uint32_t size,
|
|
|
|
|
enum gs_color_format color_format, uint32_t levels,
|
|
|
|
|
const uint8_t **data, uint32_t flags)
|
|
|
|
|
{
|
|
|
|
@@ -576,7 +576,7 @@ gs_texture_t device_cubetexture_create(gs_device_t device, uint32_t size,
|
|
|
|
|
return texture;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_texture_t device_voltexture_create(gs_device_t device, uint32_t width,
|
|
|
|
|
gs_texture_t *device_voltexture_create(gs_device_t *device, uint32_t width,
|
|
|
|
|
uint32_t height, uint32_t depth,
|
|
|
|
|
enum gs_color_format color_format, uint32_t levels,
|
|
|
|
|
const uint8_t **data, uint32_t flags)
|
|
|
|
@@ -593,7 +593,7 @@ gs_texture_t device_voltexture_create(gs_device_t device, uint32_t width,
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_zstencil_t device_zstencil_create(gs_device_t device, uint32_t width,
|
|
|
|
|
gs_zstencil_t *device_zstencil_create(gs_device_t *device, uint32_t width,
|
|
|
|
|
uint32_t height, enum gs_zstencil_format format)
|
|
|
|
|
{
|
|
|
|
|
gs_zstencil_buffer *zstencil = NULL;
|
|
|
|
@@ -608,7 +608,7 @@ gs_zstencil_t device_zstencil_create(gs_device_t device, uint32_t width,
|
|
|
|
|
return zstencil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_stagesurf_t device_stagesurface_create(gs_device_t device, uint32_t width,
|
|
|
|
|
gs_stagesurf_t *device_stagesurface_create(gs_device_t *device, uint32_t width,
|
|
|
|
|
uint32_t height, enum gs_color_format color_format)
|
|
|
|
|
{
|
|
|
|
|
gs_stage_surface *surf = NULL;
|
|
|
|
@@ -624,7 +624,7 @@ gs_stagesurf_t device_stagesurface_create(gs_device_t device, uint32_t width,
|
|
|
|
|
return surf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_samplerstate_t device_samplerstate_create(gs_device_t device,
|
|
|
|
|
gs_samplerstate_t *device_samplerstate_create(gs_device_t *device,
|
|
|
|
|
struct gs_sampler_info *info)
|
|
|
|
|
{
|
|
|
|
|
gs_sampler_state *ss = NULL;
|
|
|
|
@@ -639,7 +639,7 @@ gs_samplerstate_t device_samplerstate_create(gs_device_t device,
|
|
|
|
|
return ss;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_shader_t device_vertexshader_create(gs_device_t device,
|
|
|
|
|
gs_shader_t *device_vertexshader_create(gs_device_t *device,
|
|
|
|
|
const char *shader_string, const char *file,
|
|
|
|
|
char **error_string)
|
|
|
|
|
{
|
|
|
|
@@ -668,7 +668,7 @@ gs_shader_t device_vertexshader_create(gs_device_t device,
|
|
|
|
|
return shader;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_shader_t device_pixelshader_create(gs_device_t device,
|
|
|
|
|
gs_shader_t *device_pixelshader_create(gs_device_t *device,
|
|
|
|
|
const char *shader_string, const char *file,
|
|
|
|
|
char **error_string)
|
|
|
|
|
{
|
|
|
|
@@ -697,7 +697,7 @@ gs_shader_t device_pixelshader_create(gs_device_t device,
|
|
|
|
|
return shader;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_vertbuffer_t device_vertexbuffer_create(gs_device_t device,
|
|
|
|
|
gs_vertbuffer_t *device_vertexbuffer_create(gs_device_t *device,
|
|
|
|
|
struct gs_vb_data *data, uint32_t flags)
|
|
|
|
|
{
|
|
|
|
|
gs_vertex_buffer *buffer = NULL;
|
|
|
|
@@ -715,7 +715,7 @@ gs_vertbuffer_t device_vertexbuffer_create(gs_device_t device,
|
|
|
|
|
return buffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_indexbuffer_t device_indexbuffer_create(gs_device_t device,
|
|
|
|
|
gs_indexbuffer_t *device_indexbuffer_create(gs_device_t *device,
|
|
|
|
|
enum gs_index_type type, void *indices, size_t num,
|
|
|
|
|
uint32_t flags)
|
|
|
|
|
{
|
|
|
|
@@ -730,12 +730,12 @@ gs_indexbuffer_t device_indexbuffer_create(gs_device_t device,
|
|
|
|
|
return buffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum gs_texture_type device_get_texture_type(gs_texture_t texture)
|
|
|
|
|
enum gs_texture_type device_get_texture_type(gs_texture_t *texture)
|
|
|
|
|
{
|
|
|
|
|
return texture->type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_vertexbuffer(gs_device_t device, gs_vertbuffer_t vertbuffer)
|
|
|
|
|
void device_load_vertexbuffer(gs_device_t *device, gs_vertbuffer_t *vertbuffer)
|
|
|
|
|
{
|
|
|
|
|
if (device->curVertexBuffer == vertbuffer)
|
|
|
|
|
return;
|
|
|
|
@@ -764,7 +764,7 @@ void device_load_vertexbuffer(gs_device_t device, gs_vertbuffer_t vertbuffer)
|
|
|
|
|
buffers.data(), strides.data(), offsets.data());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_indexbuffer(gs_device_t device, gs_indexbuffer_t indexbuffer)
|
|
|
|
|
void device_load_indexbuffer(gs_device_t *device, gs_indexbuffer_t *indexbuffer)
|
|
|
|
|
{
|
|
|
|
|
DXGI_FORMAT format;
|
|
|
|
|
ID3D11Buffer *buffer;
|
|
|
|
@@ -789,7 +789,7 @@ void device_load_indexbuffer(gs_device_t device, gs_indexbuffer_t indexbuffer)
|
|
|
|
|
device->context->IASetIndexBuffer(buffer, format, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_texture(gs_device_t device, gs_texture_t tex, int unit)
|
|
|
|
|
void device_load_texture(gs_device_t *device, gs_texture_t *tex, int unit)
|
|
|
|
|
{
|
|
|
|
|
ID3D11ShaderResourceView *view = NULL;
|
|
|
|
|
|
|
|
|
@@ -803,8 +803,8 @@ void device_load_texture(gs_device_t device, gs_texture_t tex, int unit)
|
|
|
|
|
device->context->PSSetShaderResources(unit, 1, &view);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_samplerstate(gs_device_t device,
|
|
|
|
|
gs_samplerstate_t samplerstate, int unit)
|
|
|
|
|
void device_load_samplerstate(gs_device_t *device,
|
|
|
|
|
gs_samplerstate_t *samplerstate, int unit)
|
|
|
|
|
{
|
|
|
|
|
ID3D11SamplerState *state = NULL;
|
|
|
|
|
|
|
|
|
@@ -818,7 +818,7 @@ void device_load_samplerstate(gs_device_t device,
|
|
|
|
|
device->context->PSSetSamplers(unit, 1, &state);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_vertexshader(gs_device_t device, gs_shader_t vertshader)
|
|
|
|
|
void device_load_vertexshader(gs_device_t *device, gs_shader_t *vertshader)
|
|
|
|
|
{
|
|
|
|
|
ID3D11VertexShader *shader = NULL;
|
|
|
|
|
ID3D11InputLayout *layout = NULL;
|
|
|
|
@@ -855,7 +855,7 @@ void device_load_vertexshader(gs_device_t device, gs_shader_t vertshader)
|
|
|
|
|
device_load_vertexbuffer(device, curVB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void clear_textures(gs_device_t device)
|
|
|
|
|
static inline void clear_textures(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
ID3D11ShaderResourceView *views[GS_MAX_TEXTURES];
|
|
|
|
|
memset(views, 0, sizeof(views));
|
|
|
|
@@ -863,7 +863,7 @@ static inline void clear_textures(gs_device_t device)
|
|
|
|
|
device->context->PSSetShaderResources(0, GS_MAX_TEXTURES, views);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_pixelshader(gs_device_t device, gs_shader_t pixelshader)
|
|
|
|
|
void device_load_pixelshader(gs_device_t *device, gs_shader_t *pixelshader)
|
|
|
|
|
{
|
|
|
|
|
ID3D11PixelShader *shader = NULL;
|
|
|
|
|
ID3D11Buffer *constants = NULL;
|
|
|
|
@@ -902,7 +902,7 @@ void device_load_pixelshader(gs_device_t device, gs_shader_t pixelshader)
|
|
|
|
|
device->curSamplers[i] = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_default_samplerstate(gs_device_t device, bool b_3d, int unit)
|
|
|
|
|
void device_load_default_samplerstate(gs_device_t *device, bool b_3d, int unit)
|
|
|
|
|
{
|
|
|
|
|
/* TODO */
|
|
|
|
|
UNUSED_PARAMETER(device);
|
|
|
|
@@ -910,17 +910,17 @@ void device_load_default_samplerstate(gs_device_t device, bool b_3d, int unit)
|
|
|
|
|
UNUSED_PARAMETER(unit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_shader_t device_get_vertex_shader(gs_device_t device)
|
|
|
|
|
gs_shader_t *device_get_vertex_shader(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
return device->curVertexShader;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_shader_t device_get_pixel_shader(gs_device_t device)
|
|
|
|
|
gs_shader_t *device_get_pixel_shader(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
return device->curPixelShader;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_texture_t device_get_render_target(gs_device_t device)
|
|
|
|
|
gs_texture_t *device_get_render_target(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
if (device->curRenderTarget == &device->curSwapChain->target)
|
|
|
|
|
return NULL;
|
|
|
|
@@ -928,7 +928,7 @@ gs_texture_t device_get_render_target(gs_device_t device)
|
|
|
|
|
return device->curRenderTarget;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gs_zstencil_t device_get_zstencil_target(gs_device_t device)
|
|
|
|
|
gs_zstencil_t *device_get_zstencil_target(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
if (device->curZStencilBuffer == &device->curSwapChain->zs)
|
|
|
|
|
return NULL;
|
|
|
|
@@ -936,8 +936,8 @@ gs_zstencil_t device_get_zstencil_target(gs_device_t device)
|
|
|
|
|
return device->curZStencilBuffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_set_render_target(gs_device_t device, gs_texture_t tex,
|
|
|
|
|
gs_zstencil_t zstencil)
|
|
|
|
|
void device_set_render_target(gs_device_t *device, gs_texture_t *tex,
|
|
|
|
|
gs_zstencil_t *zstencil)
|
|
|
|
|
{
|
|
|
|
|
if (!tex)
|
|
|
|
|
tex = &device->curSwapChain->target;
|
|
|
|
@@ -969,8 +969,8 @@ void device_set_render_target(gs_device_t device, gs_texture_t tex,
|
|
|
|
|
device->context->OMSetRenderTargets(1, &rt, zstencil->view);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_set_cube_render_target(gs_device_t device, gs_texture_t tex,
|
|
|
|
|
int side, gs_zstencil_t zstencil)
|
|
|
|
|
void device_set_cube_render_target(gs_device_t *device, gs_texture_t *tex,
|
|
|
|
|
int side, gs_zstencil_t *zstencil)
|
|
|
|
|
{
|
|
|
|
|
if (!tex) {
|
|
|
|
|
tex = &device->curSwapChain->target;
|
|
|
|
@@ -1008,7 +1008,7 @@ void device_set_cube_render_target(gs_device_t device, gs_texture_t tex,
|
|
|
|
|
|
|
|
|
|
inline void gs_device::CopyTex(ID3D11Texture2D *dst,
|
|
|
|
|
uint32_t dst_x, uint32_t dst_y,
|
|
|
|
|
gs_texture_t src, uint32_t src_x, uint32_t src_y,
|
|
|
|
|
gs_texture_t *src, uint32_t src_x, uint32_t src_y,
|
|
|
|
|
uint32_t src_w, uint32_t src_h)
|
|
|
|
|
{
|
|
|
|
|
if (src->type != GS_TEXTURE_2D)
|
|
|
|
@@ -1043,9 +1043,9 @@ inline void gs_device::CopyTex(ID3D11Texture2D *dst,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_copy_texture_region(gs_device_t device,
|
|
|
|
|
gs_texture_t dst, uint32_t dst_x, uint32_t dst_y,
|
|
|
|
|
gs_texture_t src, uint32_t src_x, uint32_t src_y,
|
|
|
|
|
void device_copy_texture_region(gs_device_t *device,
|
|
|
|
|
gs_texture_t *dst, uint32_t dst_x, uint32_t dst_y,
|
|
|
|
|
gs_texture_t *src, uint32_t src_x, uint32_t src_y,
|
|
|
|
|
uint32_t src_w, uint32_t src_h)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
@@ -1092,13 +1092,14 @@ void device_copy_texture_region(gs_device_t device,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_copy_texture(gs_device_t device, gs_texture_t dst, gs_texture_t src)
|
|
|
|
|
void device_copy_texture(gs_device_t *device, gs_texture_t *dst,
|
|
|
|
|
gs_texture_t *src)
|
|
|
|
|
{
|
|
|
|
|
device_copy_texture_region(device, dst, 0, 0, src, 0, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_stage_texture(gs_device_t device, gs_stagesurf_t dst,
|
|
|
|
|
gs_texture_t src)
|
|
|
|
|
void device_stage_texture(gs_device_t *device, gs_stagesurf_t *dst,
|
|
|
|
|
gs_texture_t *src)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
gs_texture_2d *src2d = static_cast<gs_texture_2d*>(src);
|
|
|
|
@@ -1123,12 +1124,12 @@ void device_stage_texture(gs_device_t device, gs_stagesurf_t dst,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_begin_scene(gs_device_t device)
|
|
|
|
|
void device_begin_scene(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
clear_textures(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_draw(gs_device_t device, enum gs_draw_mode draw_mode,
|
|
|
|
|
void device_draw(gs_device_t *device, enum gs_draw_mode draw_mode,
|
|
|
|
|
uint32_t start_vert, uint32_t num_verts)
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
@@ -1141,7 +1142,7 @@ void device_draw(gs_device_t device, enum gs_draw_mode draw_mode,
|
|
|
|
|
if (!device->curVertexBuffer)
|
|
|
|
|
throw "No vertex buffer specified";
|
|
|
|
|
|
|
|
|
|
gs_effect_t effect = gs_get_effect();
|
|
|
|
|
gs_effect_t *effect = gs_get_effect();
|
|
|
|
|
if (effect)
|
|
|
|
|
gs_effect_update_params(effect);
|
|
|
|
|
|
|
|
|
@@ -1179,16 +1180,16 @@ void device_draw(gs_device_t device, enum gs_draw_mode draw_mode,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_end_scene(gs_device_t device)
|
|
|
|
|
void device_end_scene(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
/* does nothing in D3D11 */
|
|
|
|
|
UNUSED_PARAMETER(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_load_swapchain(gs_device_t device, gs_swapchain_t swapchain)
|
|
|
|
|
void device_load_swapchain(gs_device_t *device, gs_swapchain_t *swapchain)
|
|
|
|
|
{
|
|
|
|
|
gs_texture_t target = device->curRenderTarget;
|
|
|
|
|
gs_zstencil_t zs = device->curZStencilBuffer;
|
|
|
|
|
gs_texture_t *target = device->curRenderTarget;
|
|
|
|
|
gs_zstencil_t *zs = device->curZStencilBuffer;
|
|
|
|
|
bool is_cube = device->curRenderTarget->type == GS_TEXTURE_CUBE;
|
|
|
|
|
|
|
|
|
|
if (target == &device->curSwapChain->target)
|
|
|
|
@@ -1208,7 +1209,7 @@ void device_load_swapchain(gs_device_t device, gs_swapchain_t swapchain)
|
|
|
|
|
device_set_render_target(device, target, zs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_clear(gs_device_t device, uint32_t clear_flags, struct vec4 *color,
|
|
|
|
|
void device_clear(gs_device_t *device, uint32_t clear_flags, struct vec4 *color,
|
|
|
|
|
float depth, uint8_t stencil)
|
|
|
|
|
{
|
|
|
|
|
int side = device->curRenderSide;
|
|
|
|
@@ -1231,17 +1232,17 @@ void device_clear(gs_device_t device, uint32_t clear_flags, struct vec4 *color,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_present(gs_device_t device)
|
|
|
|
|
void device_present(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
device->curSwapChain->swap->Present(0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_flush(gs_device_t device)
|
|
|
|
|
void device_flush(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
device->context->Flush();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_set_cull_mode(gs_device_t device, enum gs_cull_mode mode)
|
|
|
|
|
void device_set_cull_mode(gs_device_t *device, enum gs_cull_mode mode)
|
|
|
|
|
{
|
|
|
|
|
if (mode == device->rasterState.cullMode)
|
|
|
|
|
return;
|
|
|
|
@@ -1250,12 +1251,12 @@ void device_set_cull_mode(gs_device_t device, enum gs_cull_mode mode)
|
|
|
|
|
device->rasterStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum gs_cull_mode device_get_cull_mode(gs_device_t device)
|
|
|
|
|
enum gs_cull_mode device_get_cull_mode(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
return device->rasterState.cullMode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_enable_blending(gs_device_t device, bool enable)
|
|
|
|
|
void device_enable_blending(gs_device_t *device, bool enable)
|
|
|
|
|
{
|
|
|
|
|
if (enable == device->blendState.blendEnabled)
|
|
|
|
|
return;
|
|
|
|
@@ -1264,7 +1265,7 @@ void device_enable_blending(gs_device_t device, bool enable)
|
|
|
|
|
device->blendStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_enable_depth_test(gs_device_t device, bool enable)
|
|
|
|
|
void device_enable_depth_test(gs_device_t *device, bool enable)
|
|
|
|
|
{
|
|
|
|
|
if (enable == device->zstencilState.depthEnabled)
|
|
|
|
|
return;
|
|
|
|
@@ -1273,7 +1274,7 @@ void device_enable_depth_test(gs_device_t device, bool enable)
|
|
|
|
|
device->zstencilStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_enable_stencil_test(gs_device_t device, bool enable)
|
|
|
|
|
void device_enable_stencil_test(gs_device_t *device, bool enable)
|
|
|
|
|
{
|
|
|
|
|
if (enable == device->zstencilState.stencilEnabled)
|
|
|
|
|
return;
|
|
|
|
@@ -1282,7 +1283,7 @@ void device_enable_stencil_test(gs_device_t device, bool enable)
|
|
|
|
|
device->zstencilStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_enable_stencil_write(gs_device_t device, bool enable)
|
|
|
|
|
void device_enable_stencil_write(gs_device_t *device, bool enable)
|
|
|
|
|
{
|
|
|
|
|
if (enable == device->zstencilState.stencilWriteEnabled)
|
|
|
|
|
return;
|
|
|
|
@@ -1291,7 +1292,7 @@ void device_enable_stencil_write(gs_device_t device, bool enable)
|
|
|
|
|
device->zstencilStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_enable_color(gs_device_t device, bool red, bool green,
|
|
|
|
|
void device_enable_color(gs_device_t *device, bool red, bool green,
|
|
|
|
|
bool blue, bool alpha)
|
|
|
|
|
{
|
|
|
|
|
if (device->blendState.redEnabled == red &&
|
|
|
|
@@ -1307,7 +1308,7 @@ void device_enable_color(gs_device_t device, bool red, bool green,
|
|
|
|
|
device->blendStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_blend_function(gs_device_t device, enum gs_blend_type src,
|
|
|
|
|
void device_blend_function(gs_device_t *device, enum gs_blend_type src,
|
|
|
|
|
enum gs_blend_type dest)
|
|
|
|
|
{
|
|
|
|
|
if (device->blendState.srcFactor == src &&
|
|
|
|
@@ -1319,7 +1320,7 @@ void device_blend_function(gs_device_t device, enum gs_blend_type src,
|
|
|
|
|
device->blendStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_depth_function(gs_device_t device, enum gs_depth_test test)
|
|
|
|
|
void device_depth_function(gs_device_t *device, enum gs_depth_test test)
|
|
|
|
|
{
|
|
|
|
|
if (device->zstencilState.depthFunc == test)
|
|
|
|
|
return;
|
|
|
|
@@ -1328,8 +1329,8 @@ void device_depth_function(gs_device_t device, enum gs_depth_test test)
|
|
|
|
|
device->zstencilStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void update_stencilside_test(gs_device_t device, StencilSide &side,
|
|
|
|
|
gs_depth_test test)
|
|
|
|
|
static inline void update_stencilside_test(gs_device_t *device,
|
|
|
|
|
StencilSide &side, gs_depth_test test)
|
|
|
|
|
{
|
|
|
|
|
if (side.test == test)
|
|
|
|
|
return;
|
|
|
|
@@ -1338,7 +1339,7 @@ static inline void update_stencilside_test(gs_device_t device, StencilSide &side
|
|
|
|
|
device->zstencilStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_stencil_function(gs_device_t device, enum gs_stencil_side side,
|
|
|
|
|
void device_stencil_function(gs_device_t *device, enum gs_stencil_side side,
|
|
|
|
|
enum gs_depth_test test)
|
|
|
|
|
{
|
|
|
|
|
int sideVal = (int)side;
|
|
|
|
@@ -1351,7 +1352,7 @@ void device_stencil_function(gs_device_t device, enum gs_stencil_side side,
|
|
|
|
|
device->zstencilState.stencilBack, test);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void update_stencilside_op(gs_device_t device, StencilSide &side,
|
|
|
|
|
static inline void update_stencilside_op(gs_device_t *device, StencilSide &side,
|
|
|
|
|
enum gs_stencil_op_type fail, enum gs_stencil_op_type zfail,
|
|
|
|
|
enum gs_stencil_op_type zpass)
|
|
|
|
|
{
|
|
|
|
@@ -1364,7 +1365,7 @@ static inline void update_stencilside_op(gs_device_t device, StencilSide &side,
|
|
|
|
|
device->zstencilStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_stencil_op(gs_device_t device, enum gs_stencil_side side,
|
|
|
|
|
void device_stencil_op(gs_device_t *device, enum gs_stencil_side side,
|
|
|
|
|
enum gs_stencil_op_type fail, enum gs_stencil_op_type zfail,
|
|
|
|
|
enum gs_stencil_op_type zpass)
|
|
|
|
|
{
|
|
|
|
@@ -1380,7 +1381,7 @@ void device_stencil_op(gs_device_t device, enum gs_stencil_side side,
|
|
|
|
|
fail, zfail, zpass);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_set_viewport(gs_device_t device, int x, int y, int width,
|
|
|
|
|
void device_set_viewport(gs_device_t *device, int x, int y, int width,
|
|
|
|
|
int height)
|
|
|
|
|
{
|
|
|
|
|
D3D11_VIEWPORT vp;
|
|
|
|
@@ -1398,12 +1399,12 @@ void device_set_viewport(gs_device_t device, int x, int y, int width,
|
|
|
|
|
device->viewport.cy = height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_get_viewport(gs_device_t device, struct gs_rect *rect)
|
|
|
|
|
void device_get_viewport(gs_device_t *device, struct gs_rect *rect)
|
|
|
|
|
{
|
|
|
|
|
memcpy(rect, &device->viewport, sizeof(gs_rect));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_set_scissor_rect(gs_device_t device, struct gs_rect *rect)
|
|
|
|
|
void device_set_scissor_rect(gs_device_t *device, struct gs_rect *rect)
|
|
|
|
|
{
|
|
|
|
|
D3D11_RECT d3drect;
|
|
|
|
|
|
|
|
|
@@ -1420,7 +1421,7 @@ void device_set_scissor_rect(gs_device_t device, struct gs_rect *rect)
|
|
|
|
|
device->rasterStateChanged = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_ortho(gs_device_t device, float left, float right, float top,
|
|
|
|
|
void device_ortho(gs_device_t *device, float left, float right, float top,
|
|
|
|
|
float bottom, float zNear, float zFar)
|
|
|
|
|
{
|
|
|
|
|
matrix4 *dst = &device->curProjMatrix;
|
|
|
|
@@ -1446,7 +1447,7 @@ void device_ortho(gs_device_t device, float left, float right, float top,
|
|
|
|
|
dst->t.w = 1.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_frustum(gs_device_t device, float left, float right, float top,
|
|
|
|
|
void device_frustum(gs_device_t *device, float left, float right, float top,
|
|
|
|
|
float bottom, float zNear, float zFar)
|
|
|
|
|
{
|
|
|
|
|
matrix4 *dst = &device->curProjMatrix;
|
|
|
|
@@ -1473,14 +1474,14 @@ void device_frustum(gs_device_t device, float left, float right, float top,
|
|
|
|
|
dst->z.w = 1.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_projection_push(gs_device_t device)
|
|
|
|
|
void device_projection_push(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
mat4float mat;
|
|
|
|
|
memcpy(&mat, &device->curProjMatrix, sizeof(matrix4));
|
|
|
|
|
device->projStack.push_back(mat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void device_projection_pop(gs_device_t device)
|
|
|
|
|
void device_projection_pop(gs_device_t *device)
|
|
|
|
|
{
|
|
|
|
|
if (!device->projStack.size())
|
|
|
|
|
return;
|
|
|
|
@@ -1493,7 +1494,7 @@ void device_projection_pop(gs_device_t device)
|
|
|
|
|
device->projStack.pop_back();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gs_swapchain_destroy(gs_swapchain_t swapchain)
|
|
|
|
|
void gs_swapchain_destroy(gs_swapchain_t *swapchain)
|
|
|
|
|
{
|
|
|
|
|
if (!swapchain)
|
|
|
|
|
return;
|
|
|
|
@@ -1505,12 +1506,12 @@ void gs_swapchain_destroy(gs_swapchain_t swapchain)
|
|
|
|
|
delete swapchain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gs_texture_destroy(gs_texture_t tex)
|
|
|
|
|
void gs_texture_destroy(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
delete tex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_texture_get_width(gs_texture_t tex)
|
|
|
|
|
uint32_t gs_texture_get_width(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
if (tex->type != GS_TEXTURE_2D)
|
|
|
|
|
return 0;
|
|
|
|
@@ -1518,7 +1519,7 @@ uint32_t gs_texture_get_width(gs_texture_t tex)
|
|
|
|
|
return static_cast<gs_texture_2d*>(tex)->width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_texture_get_height(gs_texture_t tex)
|
|
|
|
|
uint32_t gs_texture_get_height(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
if (tex->type != GS_TEXTURE_2D)
|
|
|
|
|
return 0;
|
|
|
|
@@ -1526,7 +1527,7 @@ uint32_t gs_texture_get_height(gs_texture_t tex)
|
|
|
|
|
return static_cast<gs_texture_2d*>(tex)->height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum gs_color_format gs_texture_get_color_format(gs_texture_t tex)
|
|
|
|
|
enum gs_color_format gs_texture_get_color_format(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
if (tex->type != GS_TEXTURE_2D)
|
|
|
|
|
return GS_UNKNOWN;
|
|
|
|
@@ -1534,7 +1535,7 @@ enum gs_color_format gs_texture_get_color_format(gs_texture_t tex)
|
|
|
|
|
return static_cast<gs_texture_2d*>(tex)->format;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool gs_texture_map(gs_texture_t tex, uint8_t **ptr, uint32_t *linesize)
|
|
|
|
|
bool gs_texture_map(gs_texture_t *tex, uint8_t **ptr, uint32_t *linesize)
|
|
|
|
|
{
|
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
|
@@ -1554,7 +1555,7 @@ bool gs_texture_map(gs_texture_t tex, uint8_t **ptr, uint32_t *linesize)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gs_texture_unmap(gs_texture_t tex)
|
|
|
|
|
void gs_texture_unmap(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
if (tex->type != GS_TEXTURE_2D)
|
|
|
|
|
return;
|
|
|
|
@@ -1563,7 +1564,7 @@ void gs_texture_unmap(gs_texture_t tex)
|
|
|
|
|
tex2d->device->context->Unmap(tex2d->texture, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *gs_texture_get_obj(gs_texture_t tex)
|
|
|
|
|
void *gs_texture_get_obj(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
if (tex->type != GS_TEXTURE_2D)
|
|
|
|
|
return nullptr;
|
|
|
|
@@ -1573,12 +1574,12 @@ void *gs_texture_get_obj(gs_texture_t tex)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gs_cubetexture_destroy(gs_texture_t cubetex)
|
|
|
|
|
void gs_cubetexture_destroy(gs_texture_t *cubetex)
|
|
|
|
|
{
|
|
|
|
|
delete cubetex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_cubetexture_get_size(gs_texture_t cubetex)
|
|
|
|
|
uint32_t gs_cubetexture_get_size(gs_texture_t *cubetex)
|
|
|
|
|
{
|
|
|
|
|
if (cubetex->type != GS_TEXTURE_CUBE)
|
|
|
|
|
return 0;
|
|
|
|
@@ -1587,7 +1588,7 @@ uint32_t gs_cubetexture_get_size(gs_texture_t cubetex)
|
|
|
|
|
return tex->width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum gs_color_format gs_cubetexture_get_color_format(gs_texture_t cubetex)
|
|
|
|
|
enum gs_color_format gs_cubetexture_get_color_format(gs_texture_t *cubetex)
|
|
|
|
|
{
|
|
|
|
|
if (cubetex->type != GS_TEXTURE_CUBE)
|
|
|
|
|
return GS_UNKNOWN;
|
|
|
|
@@ -1597,33 +1598,33 @@ enum gs_color_format gs_cubetexture_get_color_format(gs_texture_t cubetex)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gs_voltexture_destroy(gs_texture_t voltex)
|
|
|
|
|
void gs_voltexture_destroy(gs_texture_t *voltex)
|
|
|
|
|
{
|
|
|
|
|
delete voltex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_voltexture_get_width(gs_texture_t voltex)
|
|
|
|
|
uint32_t gs_voltexture_get_width(gs_texture_t *voltex)
|
|
|
|
|
{
|
|
|
|
|
/* TODO */
|
|
|
|
|
UNUSED_PARAMETER(voltex);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_voltexture_get_height(gs_texture_t voltex)
|
|
|
|
|
uint32_t gs_voltexture_get_height(gs_texture_t *voltex)
|
|
|
|
|
{
|
|
|
|
|
/* TODO */
|
|
|
|
|
UNUSED_PARAMETER(voltex);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_voltexture_getdepth(gs_texture_t voltex)
|
|
|
|
|
uint32_t gs_voltexture_getdepth(gs_texture_t *voltex)
|
|
|
|
|
{
|
|
|
|
|
/* TODO */
|
|
|
|
|
UNUSED_PARAMETER(voltex);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum gs_color_format gs_voltexture_get_color_format(gs_texture_t voltex)
|
|
|
|
|
enum gs_color_format gs_voltexture_get_color_format(gs_texture_t *voltex)
|
|
|
|
|
{
|
|
|
|
|
/* TODO */
|
|
|
|
|
UNUSED_PARAMETER(voltex);
|
|
|
|
@@ -1631,27 +1632,27 @@ enum gs_color_format gs_voltexture_get_color_format(gs_texture_t voltex)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gs_stagesurface_destroy(gs_stagesurf_t stagesurf)
|
|
|
|
|
void gs_stagesurface_destroy(gs_stagesurf_t *stagesurf)
|
|
|
|
|
{
|
|
|
|
|
delete stagesurf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_stagesurface_get_width(gs_stagesurf_t stagesurf)
|
|
|
|
|
uint32_t gs_stagesurface_get_width(gs_stagesurf_t *stagesurf)
|
|
|
|
|
{
|
|
|
|
|
return stagesurf->width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t gs_stagesurface_get_height(gs_stagesurf_t stagesurf)
|
|
|
|
|
uint32_t gs_stagesurface_get_height(gs_stagesurf_t *stagesurf)
|
|
|
|
|
{
|
|
|
|
|
return stagesurf->height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum gs_color_format gs_stagesurface_get_color_format(gs_stagesurf_t stagesurf)
|
|
|
|
|
enum gs_color_format gs_stagesurface_get_color_format(gs_stagesurf_t *stagesurf)
|
|
|
|
|
{
|
|
|
|
|
return stagesurf->format;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool gs_stagesurface_map(gs_stagesurf_t stagesurf, uint8_t **data,
|
|
|
|
|
bool gs_stagesurface_map(gs_stagesurf_t *stagesurf, uint8_t **data,
|
|
|
|
|
uint32_t *linesize)
|
|
|
|
|
{
|
|
|
|
|
D3D11_MAPPED_SUBRESOURCE map;
|
|
|
|
@@ -1664,19 +1665,19 @@ bool gs_stagesurface_map(gs_stagesurf_t stagesurf, uint8_t **data,
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gs_stagesurface_unmap(gs_stagesurf_t stagesurf)
|
|
|
|
|
void gs_stagesurface_unmap(gs_stagesurf_t *stagesurf)
|
|
|
|
|
{
|
|
|
|
|
stagesurf->device->context->Unmap(stagesurf->texture, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gs_zstencil_destroy(gs_zstencil_t zstencil)
|
|
|
|
|
void gs_zstencil_destroy(gs_zstencil_t *zstencil)
|
|
|
|
|
{
|
|
|
|
|
delete zstencil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gs_samplerstate_destroy(gs_samplerstate_t samplerstate)
|
|
|
|
|
void gs_samplerstate_destroy(gs_samplerstate_t *samplerstate)
|
|
|
|
|
{
|
|
|
|
|
if (!samplerstate)
|
|
|
|
|
return;
|
|
|
|
@@ -1691,12 +1692,12 @@ void gs_samplerstate_destroy(gs_samplerstate_t samplerstate)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gs_vertexbuffer_destroy(gs_vertbuffer_t vertbuffer)
|
|
|
|
|
void gs_vertexbuffer_destroy(gs_vertbuffer_t *vertbuffer)
|
|
|
|
|
{
|
|
|
|
|
delete vertbuffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gs_vertexbuffer_flush(gs_vertbuffer_t vertbuffer)
|
|
|
|
|
void gs_vertexbuffer_flush(gs_vertbuffer_t *vertbuffer)
|
|
|
|
|
{
|
|
|
|
|
if (!vertbuffer->dynamic) {
|
|
|
|
|
blog(LOG_ERROR, "gs_vertexbuffer_flush: vertex buffer is "
|
|
|
|
@@ -1726,18 +1727,18 @@ void gs_vertexbuffer_flush(gs_vertbuffer_t vertbuffer)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct gs_vb_data *gs_vertexbuffer_get_data(gs_vertbuffer_t vertbuffer)
|
|
|
|
|
struct gs_vb_data *gs_vertexbuffer_get_data(gs_vertbuffer_t *vertbuffer)
|
|
|
|
|
{
|
|
|
|
|
return vertbuffer->vbd.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gs_indexbuffer_destroy(gs_indexbuffer_t indexbuffer)
|
|
|
|
|
void gs_indexbuffer_destroy(gs_indexbuffer_t *indexbuffer)
|
|
|
|
|
{
|
|
|
|
|
delete indexbuffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gs_indexbuffer_flush(gs_indexbuffer_t indexbuffer)
|
|
|
|
|
void gs_indexbuffer_flush(gs_indexbuffer_t *indexbuffer)
|
|
|
|
|
{
|
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
|
@@ -1756,17 +1757,17 @@ void gs_indexbuffer_flush(gs_indexbuffer_t indexbuffer)
|
|
|
|
|
indexbuffer->device->context->Unmap(indexbuffer->indexBuffer, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *gs_indexbuffer_get_data(gs_indexbuffer_t indexbuffer)
|
|
|
|
|
void *gs_indexbuffer_get_data(gs_indexbuffer_t *indexbuffer)
|
|
|
|
|
{
|
|
|
|
|
return indexbuffer->indices.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t gs_indexbuffer_get_num_indices(gs_indexbuffer_t indexbuffer)
|
|
|
|
|
size_t gs_indexbuffer_get_num_indices(gs_indexbuffer_t *indexbuffer)
|
|
|
|
|
{
|
|
|
|
|
return indexbuffer->num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum gs_index_type gs_indexbuffer_get_type(gs_indexbuffer_t indexbuffer)
|
|
|
|
|
enum gs_index_type gs_indexbuffer_get_type(gs_indexbuffer_t *indexbuffer)
|
|
|
|
|
{
|
|
|
|
|
return indexbuffer->type;
|
|
|
|
|
}
|
|
|
|
@@ -1776,7 +1777,7 @@ extern "C" EXPORT bool device_gdi_texture_available(void)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" EXPORT gs_texture_t device_texture_create_gdi(gs_device_t device,
|
|
|
|
|
extern "C" EXPORT gs_texture_t *device_texture_create_gdi(gs_device_t *device,
|
|
|
|
|
uint32_t width, uint32_t height)
|
|
|
|
|
{
|
|
|
|
|
gs_texture *texture = nullptr;
|
|
|
|
@@ -1805,7 +1806,7 @@ static inline bool TextureGDICompatible(gs_texture_2d *tex2d, const char *func)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" EXPORT void *gs_texture_get_dc(gs_texture_t tex)
|
|
|
|
|
extern "C" EXPORT void *gs_texture_get_dc(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
HDC hDC = nullptr;
|
|
|
|
|
|
|
|
|
@@ -1820,7 +1821,7 @@ extern "C" EXPORT void *gs_texture_get_dc(gs_texture_t tex)
|
|
|
|
|
return hDC;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" EXPORT void gs_texture_release_dc(gs_texture_t tex)
|
|
|
|
|
extern "C" EXPORT void gs_texture_release_dc(gs_texture_t *tex)
|
|
|
|
|
{
|
|
|
|
|
if (tex->type != GS_TEXTURE_2D)
|
|
|
|
|
return;
|
|
|
|
|