New file API and improved platform layer
This commit is contained in:
parent
3110f509e3
commit
679a82c2d4
|
@ -4,7 +4,7 @@ gb single-file public domain libraries for C & C++
|
||||||
|
|
||||||
library | latest version | category | description
|
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_math.h** | 0.06c | math | Vector math library geared towards game development
|
||||||
**gb_gl.h** | 0.04c | graphics | OpenGL Helper Library
|
**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!)
|
**gb_string.h** | 0.95 | strings | A better string library (this is built into gb.h too with custom allocator support!)
|
||||||
|
|
6
gb_gl.h
6
gb_gl.h
|
@ -283,7 +283,7 @@ i32 const GBGL_INTERNAL_TEXTURE_FORMAT_F32[4] = { GL_R32F, GL_RG32F, GL_RGB32F
|
||||||
gb_inline i32
|
gb_inline i32
|
||||||
gbgl__get_texture_format(gbglBufferDataType data_type, i32 channel_count)
|
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) {
|
switch (data_type) {
|
||||||
case GBGL_BDT_U8: return GBGL_INTERNAL_TEXTURE_FORMAT_U8[channel_count-1];
|
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];
|
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)
|
gbgl__load_single_shader_from_file(gbglShader *shader, gbglShaderType type, char const *name)
|
||||||
{
|
{
|
||||||
gbglShaderError err = GBGL_SHADER_ERROR_NONE;
|
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],
|
if (ferr != GB_FILE_ERR_NONE) {
|
||||||
"%s%s", name, GBGL_SHADER_FILE_EXTENSIONS[type]) != GB_FILE_ERR_NONE) {
|
|
||||||
err = GBGL_SHADER_ERROR_UNABLE_TO_READ_FILE;
|
err = GBGL_SHADER_ERROR_UNABLE_TO_READ_FILE;
|
||||||
} else {
|
} else {
|
||||||
gb_local_persist char info_log[4096];
|
gb_local_persist char info_log[4096];
|
||||||
|
|
Loading…
Reference in New Issue