summaryrefslogtreecommitdiff
path: root/include/ta_sdl.h
diff options
context:
space:
mode:
authorConnor Thomson <blumatrikz@gmail.com>2026-09-08 18:27:39 -0700
committerConnor Thomson <blumatrikz@gmail.com>2026-09-08 18:27:39 -0700
commitf1ddc12b68b4e4c8087962de25260470e6df2bea (patch)
tree7d0440a6402a9b0ef75ded23fa64b68534255bba /include/ta_sdl.h
parent6025860a61386bf767b29c3ec5fd0d31285f1056 (diff)
Add tuxanci2 files
Diffstat (limited to 'include/ta_sdl.h')
-rw-r--r--include/ta_sdl.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/ta_sdl.h b/include/ta_sdl.h
new file mode 100644
index 0000000..8ac9b21
--- /dev/null
+++ b/include/ta_sdl.h
@@ -0,0 +1,48 @@
+/*
+ * Tuxánci 2 - A first person shooter
+ * Copyright (C) 2007-2011 Tuxánci Development Team
+ * Copyright (C) 2025-2026 Connor Thomson
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef TA_SDL_H
+#define TA_SDL_H
+
+#include <SDL3/SDL.h>
+#include <SDL3_ttf/SDL_ttf.h>
+
+void ta_sdl_init(SDL_InitFlags flags);
+void ta_sdl_shutdown(void);
+SDL_Window *ta_sdl_create_window(const char *title, int width, int height);
+SDL_IOStream *ta_sdl_io_from_file(const char *file, const char *mode);
+SDL_IOStream *ta_sdl_io_from_mem(void *mem, size_t size);
+void ta_sdl_get_window_size(SDL_Window *window, int *width, int *height);
+SDL_GPUDevice *ta_sdl_create_gpu_device(void);
+void ta_sdl_claim_window_for_gpu_device(SDL_GPUDevice *device, SDL_Window *window);
+SDL_GPUShader *ta_sdl_create_gpu_shader(SDL_GPUDevice *device, const SDL_GPUShaderCreateInfo *createinfo);
+SDL_GPUGraphicsPipeline *ta_sdl_create_gpu_graphics_pipeline(SDL_GPUDevice *device, const SDL_GPUGraphicsPipelineCreateInfo *createinfo);
+SDL_GPUTexture *ta_sdl_create_gpu_texture(SDL_GPUDevice *device, const SDL_GPUTextureCreateInfo *createinfo);
+SDL_GPUSampler *ta_sdl_create_gpu_sampler(SDL_GPUDevice *device, const SDL_GPUSamplerCreateInfo *createinfo);
+SDL_GPUTransferBuffer *ta_sdl_create_gpu_transfer_buffer(SDL_GPUDevice *device, const SDL_GPUTransferBufferCreateInfo *createinfo);
+void *ta_sdl_map_gpu_transfer_buffer(SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer, bool cycle);
+SDL_GPUCommandBuffer *ta_sdl_acquire_gpu_command_buffer(SDL_GPUDevice *device);
+SDL_GPUCopyPass *ta_sdl_begin_gpu_copy_pass(SDL_GPUCommandBuffer *command_buffer);
+SDL_GPURenderPass *ta_sdl_begin_gpu_render_pass(SDL_GPUCommandBuffer *command_buffer, const SDL_GPUColorTargetInfo *color_target_infos, Uint32 num_color_targets, const SDL_GPUDepthStencilTargetInfo *depth_stencil_target_info);
+void ta_sdl_wait_and_acquire_gpu_swapchain_texture(SDL_GPUCommandBuffer *commandbuffer, SDL_Window *window, SDL_GPUTexture **swapchain_texture);
+void ta_sdl_submit_gpu_command_buffer(SDL_GPUCommandBuffer *command_buffer);
+SDL_Surface *ta_sdl_convert_surface(SDL_Surface *surface, SDL_PixelFormat format);
+void ta_sdl_set_window_fullscreen(SDL_Window *window, bool fullscreen);
+
+#endif // TA_SDL_H \ No newline at end of file