New file API and improved platform layer

This commit is contained in:
gingerBill 2016-05-21 00:02:01 +01:00
parent 3110f509e3
commit 679a82c2d4
3 changed files with 1463 additions and 1299 deletions

View File

@ -4,7 +4,7 @@ gb single-file public domain libraries for C & C++
library | latest version | category | description
----------------|----------------|----------|-------------
**gb.h** | 0.15a | misc | Helper library (Standard library _improvement_)
**gb.h** | 0.16 | misc | Helper library (Standard library _improvement_)
**gb_math.h** | 0.06c | math | Vector math library geared towards game development
**gb_gl.h** | 0.04c | graphics | OpenGL Helper Library
**gb_string.h** | 0.95 | strings | A better string library (this is built into gb.h too with custom allocator support!)

2718
gb.h

File diff suppressed because it is too large Load Diff

View File

@ -283,7 +283,7 @@ i32 const GBGL_INTERNAL_TEXTURE_FORMAT_F32[4] = { GL_R32F, GL_RG32F, GL_RGB32F
gb_inline i32
gbgl__get_texture_format(gbglBufferDataType data_type, i32 channel_count)
{
GB_ASSERT(channel_count >= 1 && channel_count <= 4);
GB_ASSERT(gb_is_between(channel_count, 1, 4));
switch (data_type) {
case GBGL_BDT_U8: return GBGL_INTERNAL_TEXTURE_FORMAT_U8[channel_count-1];
case GBGL_BDT_I8: return GBGL_INTERNAL_TEXTURE_FORMAT_I8[channel_count-1];
@ -908,9 +908,9 @@ gbglShaderError
gbgl__load_single_shader_from_file(gbglShader *shader, gbglShaderType type, char const *name)
{
gbglShaderError err = GBGL_SHADER_ERROR_NONE;
gbFileError ferr = gb_file_open(&shader->files[type], "%s%s", name, GBGL_SHADER_FILE_EXTENSIONS[type]);
if (gb_file_open(&shader->files[type],
"%s%s", name, GBGL_SHADER_FILE_EXTENSIONS[type]) != GB_FILE_ERR_NONE) {
if (ferr != GB_FILE_ERR_NONE) {
err = GBGL_SHADER_ERROR_UNABLE_TO_READ_FILE;
} else {
gb_local_persist char info_log[4096];