diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/audio.h | 34 | ||||
| -rw-r--r-- | include/color.h | 35 | ||||
| -rw-r--r-- | include/events.h | 25 | ||||
| -rw-r--r-- | include/exit_key.h | 30 | ||||
| -rw-r--r-- | include/files.h | 67 | ||||
| -rw-r--r-- | include/forever.h | 27 | ||||
| -rw-r--r-- | include/gpu.h | 39 | ||||
| -rw-r--r-- | include/keyboard.h | 29 | ||||
| -rw-r--r-- | include/logging.h | 25 | ||||
| -rw-r--r-- | include/main.h | 25 | ||||
| -rw-r--r-- | include/mouse.h | 31 | ||||
| -rw-r--r-- | include/obj.h | 39 | ||||
| -rw-r--r-- | include/obj_model.h | 41 | ||||
| -rw-r--r-- | include/scale.h | 27 | ||||
| -rw-r--r-- | include/screen.h | 36 | ||||
| -rw-r--r-- | include/screens/main_menu.h | 29 | ||||
| -rw-r--r-- | include/ta_al.h | 27 | ||||
| -rw-r--r-- | include/ta_alc.h | 32 | ||||
| -rw-r--r-- | include/ta_openmpt.h | 30 | ||||
| -rw-r--r-- | include/ta_sdl.h | 48 | ||||
| -rw-r--r-- | include/ta_sdl_ttf.h | 32 | ||||
| -rw-r--r-- | include/teapot.h | 30 | ||||
| -rw-r--r-- | include/text.h | 44 | ||||
| -rw-r--r-- | include/version.h.in | 30 | ||||
| -rw-r--r-- | include/window.h | 35 |
25 files changed, 847 insertions, 0 deletions
diff --git a/include/audio.h b/include/audio.h new file mode 100644 index 0000000..59867c5 --- /dev/null +++ b/include/audio.h @@ -0,0 +1,34 @@ +/* + * 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/>. + */ + +#ifdef ENABLE_AUDIO +#ifndef TA_AUDIO_H +#define TA_AUDIO_H + +#include "ta_alc.h" + +extern ALCdevice *ta_audio_device; +extern ALCcontext * ta_audio_context; + +void ta_audio_init(void); +void ta_audio_update(void); +void ta_audio_destroy(void); + +#endif // TA_AUDIO_H +#endif // ENABLE_AUDIO
\ No newline at end of file diff --git a/include/color.h b/include/color.h new file mode 100644 index 0000000..e5c69d6 --- /dev/null +++ b/include/color.h @@ -0,0 +1,35 @@ +/* + * 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_COLOR_H +#define TA_COLOR_H + +typedef struct { + int red; + int green; + int blue; + int alpha; +} ta_color; + +extern ta_color ta_color_black; +extern ta_color ta_color_white; + +void ta_color_init(void); + +#endif // TA_COLOR_H
\ No newline at end of file diff --git a/include/events.h b/include/events.h new file mode 100644 index 0000000..68267fd --- /dev/null +++ b/include/events.h @@ -0,0 +1,25 @@ +/* + * 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_EVENTS_H +#define TA_EVENTS_H + +void ta_events_update(void); + +#endif // TA_EVENTS_H
\ No newline at end of file diff --git a/include/exit_key.h b/include/exit_key.h new file mode 100644 index 0000000..bd05645 --- /dev/null +++ b/include/exit_key.h @@ -0,0 +1,30 @@ +/* + * 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_EXIT_KEY_H +#define TA_EXIT_KEY_H + +#include <stdbool.h> + +extern bool ta_exit_key_ignore; + +void ta_exit_key_callback(void); +void ta_exit_key_init(void); + +#endif // TA_EXIT_KEY_H
\ No newline at end of file diff --git a/include/files.h b/include/files.h new file mode 100644 index 0000000..b5b4a9d --- /dev/null +++ b/include/files.h @@ -0,0 +1,67 @@ +/* + * 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_FILES_H +#define TA_FILES_H + +extern unsigned char *file_text_vert_slang_spv_start; +extern unsigned char *file_text_vert_slang_spv_end; +extern unsigned int file_text_vert_slang_spv_size; + +extern unsigned char *file_text_frag_slang_spv_start; +extern unsigned char *file_text_frag_slang_spv_end; +extern unsigned int file_text_frag_slang_spv_size; + +extern unsigned char *file_shape_vert_slang_spv_start; +extern unsigned char *file_shape_vert_slang_spv_end; +extern unsigned int file_shape_vert_slang_spv_size; + +extern unsigned char *file_shape_frag_slang_spv_start; +extern unsigned char *file_shape_frag_slang_spv_end; +extern unsigned int file_shape_frag_slang_spv_size; + +extern unsigned char *file_data_images_background_png_start; +extern unsigned char *file_data_images_background_png_end; +extern unsigned int file_data_images_background_png_size; + +extern unsigned char *file_data_fonts_DejaVuSans_ttf_start; +extern unsigned char *file_data_fonts_DejaVuSans_ttf_end; +extern unsigned int file_data_fonts_DejaVuSans_ttf_size; + +extern unsigned char *file_data_music_theme_it_start; +extern unsigned char *file_data_music_theme_it_end; +extern unsigned int file_data_music_theme_it_size; + +extern unsigned char *file_data_models_teapot_obj_start; +extern unsigned char *file_data_models_teapot_obj_end; +extern unsigned int file_data_models_teapot_obj_size; + +extern unsigned char *file_obj_vert_slang_spv_start; +extern unsigned char *file_obj_vert_slang_spv_end; +extern unsigned int file_obj_vert_slang_spv_size; + +extern unsigned char *file_obj_frag_slang_spv_start; +extern unsigned char *file_obj_frag_slang_spv_end; +extern unsigned int file_obj_frag_slang_spv_size; + +extern unsigned char *file_data_models_dounut_obj_start; +extern unsigned char *file_data_models_dounut_obj_end; +extern unsigned int file_data_models_dounut_obj_size; + +#endif // TA_FILES_H
\ No newline at end of file diff --git a/include/forever.h b/include/forever.h new file mode 100644 index 0000000..a1a4336 --- /dev/null +++ b/include/forever.h @@ -0,0 +1,27 @@ +/* + * 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_FOREVER_H +#define TA_FOREVER_H + +typedef void (*ta_loop)(void); + +void ta_forever(ta_loop loop); + +#endif // TA_FOREVER_H
\ No newline at end of file diff --git a/include/gpu.h b/include/gpu.h new file mode 100644 index 0000000..873c2d5 --- /dev/null +++ b/include/gpu.h @@ -0,0 +1,39 @@ +/* + * 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_GPU_H +#define TA_GPU_H + +#include <stdbool.h> +#include "ta_sdl.h" + +extern SDL_GPUDevice *ta_gpu_device; +extern SDL_GPUGraphicsPipeline *ta_gpu_text_pipeline; +extern SDL_GPUTexture *ta_gpu_text_texture; +extern SDL_GPUSampler *ta_gpu_text_sampler; +extern Uint32 ta_gpu_text_texture_width; +extern Uint32 ta_gpu_text_texture_height; +extern SDL_GPUSampleCount ta_gpu_sample_count; +extern SDL_GPUTextureFormat ta_gpu_swapchain_format; + +void ta_gpu_init(void); +void ta_gpu_start_frame(void); +void ta_gpu_end_frame(void); + +#endif // TA_RENDERER_H
\ No newline at end of file diff --git a/include/keyboard.h b/include/keyboard.h new file mode 100644 index 0000000..b47d4a3 --- /dev/null +++ b/include/keyboard.h @@ -0,0 +1,29 @@ +/* + * 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_KEYBOARD_H +#define TA_KEYBOARD_H + +typedef void (*ta_key_callback_fn)(void); + +void ta_keyboard_set_callback(int key, ta_key_callback_fn callback); +void ta_keyboard_dispatch(int key); +void ta_keyboard_shutdown(void); + +#endif // TA_KEYBOARD_H
\ No newline at end of file diff --git a/include/logging.h b/include/logging.h new file mode 100644 index 0000000..d5385e2 --- /dev/null +++ b/include/logging.h @@ -0,0 +1,25 @@ +/* + * Tuxánci 2 - A first person shooter + * Copyright (C) 2007-2010 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_LOGGING_H +#define TA_LOGGING_H + +void ta_log(const char *format, ...); + +#endif // TA_LOGGING_H
\ No newline at end of file diff --git a/include/main.h b/include/main.h new file mode 100644 index 0000000..007f84c --- /dev/null +++ b/include/main.h @@ -0,0 +1,25 @@ +/* + * 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_MAIN_H +#define TA_MAIN_H + +void ta_main_exit(int code); + +#endif // TA_MAIN_H
\ No newline at end of file diff --git a/include/mouse.h b/include/mouse.h new file mode 100644 index 0000000..ad600ef --- /dev/null +++ b/include/mouse.h @@ -0,0 +1,31 @@ +/* + * 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_MOUSE_H +#define TA_MOUSE_H + +#include <stdbool.h> + +extern int ta_mouse_x; +extern int ta_mouse_y; +extern bool ta_mouse_click; + +void ta_mouse_update(void); + +#endif // TA_MOUSE_H
\ No newline at end of file diff --git a/include/obj.h b/include/obj.h new file mode 100644 index 0000000..190b459 --- /dev/null +++ b/include/obj.h @@ -0,0 +1,39 @@ +/* + * 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_OBJ_H +#define TA_OBJ_H + +#include <stdbool.h> +#include <stddef.h> + +typedef struct ta_obj_vertex { + float position[3]; + float normal[3]; +} ta_obj_vertex; + +typedef struct ta_obj_mesh { + ta_obj_vertex *vertices; + size_t vertex_count; +} ta_obj_mesh; + +bool ta_obj_parse(const unsigned char *data, size_t size, ta_obj_mesh *mesh); +void ta_obj_free(ta_obj_mesh *mesh); + +#endif // TA_OBJ_H
\ No newline at end of file diff --git a/include/obj_model.h b/include/obj_model.h new file mode 100644 index 0000000..6f01ecf --- /dev/null +++ b/include/obj_model.h @@ -0,0 +1,41 @@ +/* + * 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_OBJ_MODEL_H +#define TA_OBJ_MODEL_H + +#include "obj.h" +#include "ta_sdl.h" + +typedef struct ta_obj_model { + SDL_GPUGraphicsPipeline *pipeline; + SDL_GPUBuffer *vertex_buffer; + ta_obj_mesh mesh; + Uint32 vertex_count; + bool uploaded; + float position[3]; + float rotation[3]; +} ta_obj_model; + +bool ta_obj_model_init(ta_obj_model *model, SDL_GPUDevice *device, const unsigned char *data, size_t size, SDL_GPUTextureFormat color_format, SDL_GPUTextureFormat depth_format, SDL_GPUSampleCount sample_count); +void ta_obj_model_upload(ta_obj_model *model, SDL_GPUCommandBuffer *command_buffer, SDL_GPUDevice *device); +void ta_obj_model_render(const ta_obj_model *model, SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass, int window_width, int window_height); +void ta_obj_model_destroy(ta_obj_model *model, SDL_GPUDevice *device); + +#endif // TA_OBJ_MODEL_H
\ No newline at end of file diff --git a/include/scale.h b/include/scale.h new file mode 100644 index 0000000..8173760 --- /dev/null +++ b/include/scale.h @@ -0,0 +1,27 @@ +/* + * 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_SCALE_H +#define TA_SCALE_H + +int X(float x); +int Y(float y); +int S(float scale); + +#endif // TA_SCALE_H
\ No newline at end of file diff --git a/include/screen.h b/include/screen.h new file mode 100644 index 0000000..0f6d9ba --- /dev/null +++ b/include/screen.h @@ -0,0 +1,36 @@ +/* + * 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_SCREEN_H +#define TA_SCREEN_H + +#include "ta_sdl.h" + +typedef enum { + NONE, + MAIN_MENU +} ta_screens; + +extern ta_screens ta_screen_current; + +void ta_screen_update(void); +void ta_screen_upload(SDL_GPUCommandBuffer *command_buffer); +void ta_screen_render(SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass); + +#endif // TA_SCREEN_H
\ No newline at end of file diff --git a/include/screens/main_menu.h b/include/screens/main_menu.h new file mode 100644 index 0000000..93eb8c6 --- /dev/null +++ b/include/screens/main_menu.h @@ -0,0 +1,29 @@ +/* + * 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_SCREENS_MAIN_MENU_H +#define TA_SCREENS_MAIN_MENU_H + +#include "ta_sdl.h" + +void ta_screens_main_menu_update(void); +void ta_screens_main_menu_upload(SDL_GPUCommandBuffer *command_buffer); +void ta_screens_main_menu_render(SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass); + +#endif // TA_SCREENS_MAIN_MENU_H
\ No newline at end of file diff --git a/include/ta_al.h b/include/ta_al.h new file mode 100644 index 0000000..59c32cc --- /dev/null +++ b/include/ta_al.h @@ -0,0 +1,27 @@ +/* + * 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/>. + */ + +#ifdef ENABLE_AUDIO +#ifndef TA_AL_H +#define TA_AL_H + +#include <AL/al.h> + +#endif // TA_AL_H +#endif // ENABLE_AUDIO
\ No newline at end of file diff --git a/include/ta_alc.h b/include/ta_alc.h new file mode 100644 index 0000000..42b0a6b --- /dev/null +++ b/include/ta_alc.h @@ -0,0 +1,32 @@ +/* + * 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/>. + */ + +#ifdef ENABLE_AUDIO +#ifndef TA_ALC_H +#define TA_ALC_H + +#include <AL/alc.h> + +ALCdevice *ta_alc_open_device(void); +ALCcontext *ta_alc_create_context(ALCdevice *device, ALCint* attrlist); +void ta_alc_make_context_current(ALCcontext *context); +void ta_alc_close_device(ALCdevice *device); + +#endif // TA_ALC_H +#endif // ENABLE_AUDIO
\ No newline at end of file diff --git a/include/ta_openmpt.h b/include/ta_openmpt.h new file mode 100644 index 0000000..f92e1e9 --- /dev/null +++ b/include/ta_openmpt.h @@ -0,0 +1,30 @@ +/* + * 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/>. + */ + +#ifdef ENABLE_AUDIO +#ifndef TA_OPENMPT_H +#define TA_OPENMPT_H + +#include <libopenmpt/libopenmpt.h> + +openmpt_module *ta_openmpt_load_module(unsigned char *start, size_t size); +void ta_openmpt_set_module_repeat_count(openmpt_module *module, int count); + +#endif // TA_OPENMPT_H +#endif // ENABLE_AUDIO
\ No newline at end of file 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 diff --git a/include/ta_sdl_ttf.h b/include/ta_sdl_ttf.h new file mode 100644 index 0000000..f3b6a8d --- /dev/null +++ b/include/ta_sdl_ttf.h @@ -0,0 +1,32 @@ +/* + * 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_TTF_H +#define TA_SDL_TTF_H + +#include <SDL3/SDL.h> +#include <SDL3_ttf/SDL_ttf.h> + +void ta_sdl_ttf_init(void); +void ta_sdl_ttf_shutdown(void); +TTF_Font *ta_sdl_ttf_open_font(SDL_IOStream *src); +void ta_sdl_ttf_set_font_size(TTF_Font *font, float ptsize); +SDL_Surface *ta_sdl_ttf_render_text_blended(TTF_Font *font, const char *text, size_t length, SDL_Color color); + +#endif // TA_SDL_TTF_H
\ No newline at end of file diff --git a/include/teapot.h b/include/teapot.h new file mode 100644 index 0000000..b19bd20 --- /dev/null +++ b/include/teapot.h @@ -0,0 +1,30 @@ +/* + * 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_TEAPOT_H +#define TA_TEAPOT_H + +#include "ta_sdl.h" + +void ta_teapot_init(void); +void ta_teapot_upload(SDL_GPUCommandBuffer *command_buffer); +void ta_teapot_render(SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass); +void ta_teapot_shutdown(void); + +#endif // TA_TEAPOT_H
\ No newline at end of file diff --git a/include/text.h b/include/text.h new file mode 100644 index 0000000..2f4d559 --- /dev/null +++ b/include/text.h @@ -0,0 +1,44 @@ +/* + * 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_TEXT_H +#define TA_TEXT_H + +#include "ta_sdl.h" +#include "color.h" + +typedef struct { + int x, y; + float size; + ta_color color; + const char *text; +} ta_text; + +extern SDL_Surface *ta_text_surface; +extern int ta_text_current_x; +extern int ta_text_current_y; + +void ta_text_init(void); +void ta_text_draw(int x, int y, float size, ta_color color, const char *format, ...); +void ta_text_clear(void); +void ta_text_shutdown(void); +void ta_gpu_upload_text(SDL_GPUCommandBuffer *command_buffer); +void ta_text_render(SDL_GPUCommandBuffer *command_buffer, SDL_GPURenderPass *render_pass); + +#endif // TA_TEXT_H diff --git a/include/version.h.in b/include/version.h.in new file mode 100644 index 0000000..3266765 --- /dev/null +++ b/include/version.h.in @@ -0,0 +1,30 @@ +/* + * 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_VERSION_H +#define TA_VERSION_H + +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) + +#define TA_VERSION "@PROJECT_VERSION@" +#define TA_BUILD_DATE __DATE__ +#define TA_BUILD_TIME __TIME__ + +#endif // TA_VERSION_H
\ No newline at end of file diff --git a/include/window.h b/include/window.h new file mode 100644 index 0000000..f249e93 --- /dev/null +++ b/include/window.h @@ -0,0 +1,35 @@ +/* + * 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_WINDOW_H +#define TA_WINDOW_H + +#include <stdbool.h> +#include "ta_sdl.h" + +extern int ta_window_width; +extern int ta_window_height; +extern bool ta_window_fullscreen; +extern SDL_Window *ta_window; + +void ta_window_init(void); +void ta_window_update(void); +void ta_window_shutdown(void); + +#endif // TA_WINDOW_H
\ No newline at end of file |