fixing stuff
This commit is contained in:
311
src/lib/KHR/khrplatform.h
Normal file
311
src/lib/KHR/khrplatform.h
Normal file
@@ -0,0 +1,311 @@
|
||||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2018 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* The master copy of khrplatform.h is maintained in the Khronos EGL
|
||||
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||
* The last semantic modification to khrplatform.h was at commit ID:
|
||||
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by filing pull requests or issues on
|
||||
* the EGL Registry repository linked above.
|
||||
*
|
||||
*
|
||||
* See the Implementer's Guidelines for information about where this file
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||
# define KHRONOS_STATIC 1
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(KHRONOS_STATIC)
|
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */
|
||||
# define KHRONOS_APICALL
|
||||
#elif defined(_WIN32)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif defined(__ANDROID__)
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
/*
|
||||
* To support platform where unsigned long cannot be used interchangeably with
|
||||
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||
* unsigned long long or similar (this results in different C++ name mangling).
|
||||
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||
* platforms where the size of a pointer is larger than the size of long.
|
||||
*/
|
||||
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||
#define KHRONOS_USE_INTPTR_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
|
||||
/*
|
||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef KHRONOS_USE_INTPTR_T
|
||||
typedef intptr_t khronos_intptr_t;
|
||||
typedef uintptr_t khronos_uintptr_t;
|
||||
#elif defined(_WIN64)
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
||||
14
src/lib/djstdlib/app.cpp
Normal file
14
src/lib/djstdlib/app.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include "core.cpp"
|
||||
#include "core.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int statusCode = 0;
|
||||
initialiseCore();
|
||||
Arena *arena = arenaAlloc(Megabytes(64));
|
||||
list<string> args = getArgs(arena, argc, argv);
|
||||
|
||||
prinft("%S", strSplit(arena, "-"_s, "hallo-world"_s));
|
||||
|
||||
return statusCode;
|
||||
}
|
||||
511
src/lib/djstdlib/core.cpp
Normal file
511
src/lib/djstdlib/core.cpp
Normal file
@@ -0,0 +1,511 @@
|
||||
#include <unistd.h> // TODO(djledda): get outta here
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#define STB_SPRINTF_IMPLEMENTATION
|
||||
#include "core.h"
|
||||
#include "os.cpp"
|
||||
|
||||
void *pushSize(Arena *arena, size_t bytes) {
|
||||
if (arena->capacity - arena->head >= bytes) {
|
||||
void *ptr = (char *)arena->memory + arena->head;
|
||||
arena->head += bytes;
|
||||
return ptr;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Arena *arenaAlloc(size_t capacity) {
|
||||
Arena *result = (Arena *)os_alloc(sizeof(Arena) + capacity);
|
||||
result->memory = result + sizeof(Arena);
|
||||
result->capacity = capacity;
|
||||
result->head = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
void arenaFree(Arena *arena) {
|
||||
os_free(arena, arena->capacity);
|
||||
}
|
||||
|
||||
void arenaFreeFrom(Arena *arena, size_t position) {
|
||||
arena->head = position;
|
||||
}
|
||||
|
||||
Arena *scratchArenas[2];
|
||||
|
||||
void initialiseCore() {
|
||||
for (EachInArray(scratchArenas, i)) {
|
||||
scratchArenas[i] = arenaAlloc(Megabytes(64));
|
||||
}
|
||||
}
|
||||
|
||||
Scratch scratchStart(Arena **conflicts, size_t conflictCount) {
|
||||
Scratch scratch = {0};
|
||||
for (size_t i = 0; i < ArrayCount(scratchArenas); i += 1) {
|
||||
bool conflicted = false;
|
||||
for (Arena **conflict = conflicts; conflict < conflicts + conflictCount; conflict += 1) {
|
||||
if (*conflict == scratchArenas[i]) {
|
||||
conflicted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (conflicted == false) {
|
||||
scratch.arena = scratchArenas[i];
|
||||
scratch.start = scratch.arena->head;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return scratch;
|
||||
}
|
||||
|
||||
#define DeferLoop(begin_stmnt, end_stmnt) for(int __defer_i = ((begin_stmnt), 0); __defer_i < 1; (++__defer_i, (end_stmnt)))
|
||||
#define WithScratch(scratchName) Scratch scratchName; DeferLoop(scratchName = scratchStart(0, 0), scratchEnd(scratchName))
|
||||
|
||||
void scratchEnd(Scratch scratch) {
|
||||
arenaFreeFrom(scratch.arena, scratch.start);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *appendList(list<T> *list, T element) {
|
||||
if (list->head < list->length) {
|
||||
list->data[list->head] = element;
|
||||
list->head++;
|
||||
return &(list->data[list->head - 1]);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void zeroListFull(list<T> *list) {
|
||||
memset(list->data, 0, list->head * sizeof(T));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void zeroList(list<T> *list) {
|
||||
list->head = 0;
|
||||
memset(list->data, 0, list->head * sizeof(T));
|
||||
}
|
||||
|
||||
inline string operator""_s(const char *cstrLiteral, unsigned long length) {
|
||||
return {
|
||||
(char *)cstrLiteral,
|
||||
length,
|
||||
};
|
||||
}
|
||||
|
||||
const char *cstring(Arena *arena, list<char> buf) {
|
||||
char *arr = PushArray(arena, char, buf.length + 1);
|
||||
memmove(arr, buf.data, buf.length);
|
||||
arr[buf.length] = '\0';
|
||||
return arr;
|
||||
}
|
||||
|
||||
const char *cstring(Arena *arena, string str) {
|
||||
char *arr = PushArray(arena, char, str.length + 1);
|
||||
memmove(arr, str.str, str.length);
|
||||
arr[str.length] = '\0';
|
||||
return arr;
|
||||
}
|
||||
|
||||
bool strEql(string s1, string s2) {
|
||||
if (s1.length != s2.length) {
|
||||
return false;
|
||||
}
|
||||
for (size_t i = 0; i < s1.length; i++) {
|
||||
if (s1.str[i] != s2.str[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t calcStringLen(const char *str) {
|
||||
size_t size = 0;
|
||||
if (str == NULL) {
|
||||
return size;
|
||||
}
|
||||
while (str[size] != '\0') {
|
||||
size++;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
string strFromCString(Arena *arena, const char *str) {
|
||||
string result = PushString(arena, calcStringLen(str));
|
||||
memcpy(result.str, str, result.length);
|
||||
return result;
|
||||
}
|
||||
|
||||
string strReverse(Arena *arena, string str) {
|
||||
string reversed = PushString(arena, str.length);
|
||||
for (
|
||||
size_t mainIndex = str.length - 1, reversedIndex = 0;
|
||||
mainIndex < str.length;
|
||||
mainIndex--, reversedIndex++
|
||||
) {
|
||||
reversed.str[reversedIndex] = str.str[mainIndex];
|
||||
}
|
||||
return reversed;
|
||||
}
|
||||
|
||||
string strPrintfv(Arena *arena, const char *fmt, va_list args) {
|
||||
string result = {0};
|
||||
va_list argsCopy;
|
||||
va_copy(argsCopy, args);
|
||||
uint64 bufSize = stb_vsnprintf(0, 0, fmt, args) + 1;
|
||||
result.str = PushArray(arena, char, bufSize);
|
||||
result.length = bufSize - 1;
|
||||
stb_vsnprintf((char *)result.str, (int)bufSize, fmt, argsCopy);
|
||||
return result;
|
||||
}
|
||||
|
||||
string strPrintf(Arena *arena, const char *fmt, ...) {
|
||||
string result = {0};
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
result = strPrintfv(arena, fmt, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
list<T> listSlice(list<T> l, size_t start, size_t stop) {
|
||||
if (stop == 0) {
|
||||
stop = l.head;
|
||||
}
|
||||
// TODO(djledda): maybe assert instead
|
||||
if (stop > l.head || start > stop) {
|
||||
return {0};
|
||||
}
|
||||
return {
|
||||
l.data + start,
|
||||
stop - start,
|
||||
stop - start,
|
||||
};
|
||||
}
|
||||
|
||||
string strSlice(string str, size_t start, size_t stop) {
|
||||
if (stop == 0) {
|
||||
stop = str.length;
|
||||
}
|
||||
// TODO(djledda): maybe assert instead
|
||||
if (stop > str.length || start > stop) {
|
||||
return {0};
|
||||
}
|
||||
return {
|
||||
str.str + start,
|
||||
stop - start,
|
||||
};
|
||||
}
|
||||
|
||||
string strSlice(char *data, size_t start, size_t stop) {
|
||||
return {
|
||||
data + start,
|
||||
stop - start,
|
||||
};
|
||||
}
|
||||
|
||||
bool stringContains(string str, char c) {
|
||||
for (size_t i = 0; i < str.length; i++) {
|
||||
if (str.str[i] == c) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
string NUMERIC_CHARS = "0123456789"_s;
|
||||
inline bool isNumeric(char c) {
|
||||
return stringContains(NUMERIC_CHARS, c);
|
||||
}
|
||||
|
||||
list<string> strSplit(Arena *arena, string splitStr, string inputStr) {
|
||||
list<string> result = {0};
|
||||
if (inputStr.length > 0) {
|
||||
size_t splitCount = 0;
|
||||
size_t c = 0;
|
||||
size_t start = 0;
|
||||
void *beginning = (char *)arena->memory + arena->head;
|
||||
while (c < inputStr.length - splitStr.length) {
|
||||
if (strEql(strSlice(inputStr, c, c + splitStr.length), splitStr)) {
|
||||
string *splitString = PushStruct(arena, string);
|
||||
splitString->str = inputStr.str + start;
|
||||
splitString->length = c - start;
|
||||
splitCount++;
|
||||
start = c + 1;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
|
||||
string *splitString = PushStruct(arena, string);
|
||||
splitString->str = inputStr.str + start;
|
||||
splitString->length = inputStr.length - start;
|
||||
splitCount++;
|
||||
result.data = (string *)beginning,
|
||||
result.head = splitCount,
|
||||
result.length = splitCount;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int8 parsePositiveInt(string str, size_t *lengthPointer) {
|
||||
size_t numEnd = 0;
|
||||
char currChar = str.str[numEnd];
|
||||
while (numEnd < str.length && isNumeric(currChar)) {
|
||||
currChar = str.str[++numEnd];
|
||||
*lengthPointer += 1;
|
||||
}
|
||||
*lengthPointer -= 1;
|
||||
if (numEnd > 0) {
|
||||
uint8 result = 0;
|
||||
for (size_t i = 0; i < numEnd; i++) {
|
||||
result *= 10;
|
||||
result += str.str[i] - '0';
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
real32 parsePositiveReal32(string str, size_t *lengthPointer) {
|
||||
real32 result = NAN;
|
||||
|
||||
string wholePartStr = string{0};
|
||||
string fractionalPartStr = string{0};
|
||||
|
||||
bool split = false;
|
||||
size_t c = 0;
|
||||
while (c < str.length) {
|
||||
if (str.str[c] == '.') {
|
||||
wholePartStr.str = str.str;
|
||||
wholePartStr.length = c;
|
||||
fractionalPartStr.str = str.str + c + 1;
|
||||
fractionalPartStr.length = str.length - c - 1;
|
||||
split = true;
|
||||
break;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
if (split) {
|
||||
int wholePart = parsePositiveInt(wholePartStr, lengthPointer);
|
||||
*lengthPointer += 1;
|
||||
int fractionalPart = parsePositiveInt(fractionalPartStr, lengthPointer);
|
||||
if (wholePart >= 0 && fractionalPart >= 0) {
|
||||
real32 fractionalPartMultiplier = 1.0f / powf(10.0f, (real32)fractionalPartStr.length);
|
||||
result = (real32)wholePart + (real32)fractionalPart * (real32)fractionalPartMultiplier;
|
||||
}
|
||||
} else if (c > 0) {
|
||||
result = (real32)parsePositiveInt(str, lengthPointer);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
string readEntireFile(Arena *arena, string filename) {
|
||||
#if OS_WINDOWS
|
||||
string result = {0};
|
||||
HANDLE fileHandle = CreateFileA(cstring(arena, filename), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL);
|
||||
if (fileHandle != INVALID_HANDLE_VALUE) {
|
||||
LARGE_INTEGER fileSize;
|
||||
if (GetFileSizeEx(fileHandle, &fileSize)) {
|
||||
string readfile = PushString(arena, (size_t)fileSize.QuadPart);
|
||||
if (readfile.str) {
|
||||
DWORD bytesRead;
|
||||
if (ReadFile(fileHandle, readfile.str, (DWORD)fileSize.QuadPart, &bytesRead, NULL) && (fileSize.QuadPart == bytesRead)) {
|
||||
result = readfile;
|
||||
}
|
||||
}
|
||||
}
|
||||
CloseHandle(fileHandle);
|
||||
}
|
||||
return result;
|
||||
#elif OS_LINUX
|
||||
FILE *input = fopen((char *)filename.str, "r");
|
||||
struct stat st;
|
||||
stat((char *)filename.str, &st);
|
||||
size_t fsize = st.st_size;
|
||||
string readBuffer = PushString(arena, fsize);
|
||||
fread(readBuffer.str, sizeof(byte), readBuffer.length, input);
|
||||
fclose(input);
|
||||
return readBuffer;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool writeEntireFile(Arena *arena, string filename, const byte *contents, size_t contentsLength) {
|
||||
bool result = false;
|
||||
#if OS_WINDOWS
|
||||
HANDLE fileHandle = CreateFileA(cstring(arena, filename), GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, NULL, NULL);
|
||||
if (fileHandle != INVALID_HANDLE_VALUE) {
|
||||
DWORD bytesWritten;
|
||||
if (WriteFile(fileHandle, contents, (DWORD)contentsLength, &bytesWritten, NULL)) {
|
||||
// file written successfully
|
||||
result = bytesWritten == contentsLength;
|
||||
}
|
||||
CloseHandle(fileHandle);
|
||||
}
|
||||
#elif OS_LINUX
|
||||
Assert(false);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
bool fileAppend(Arena *arena, string filename, const byte *contents, size_t contentsLength) {
|
||||
bool result = false;
|
||||
#if OS_WINDOWS
|
||||
HANDLE fileHandle = CreateFileA(cstring(arena, filename), FILE_APPEND_DATA | FILE_GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (fileHandle != INVALID_HANDLE_VALUE) {
|
||||
DWORD bytesWritten;
|
||||
DWORD position = SetFilePointer(fileHandle, 0, NULL, FILE_END);
|
||||
if (WriteFile(fileHandle, contents, (DWORD)contentsLength, &bytesWritten, NULL)) {
|
||||
// file written successfully
|
||||
result = bytesWritten == contentsLength;
|
||||
}
|
||||
CloseHandle(fileHandle);
|
||||
}
|
||||
#elif OS_LINUX
|
||||
Assert(false);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
list<string> getArgs(Arena *arena, int argc, char **argv) {
|
||||
list<string> args = PushList(arena, string, (size_t)argc);
|
||||
for (int i = 1; i < argc; i++) {
|
||||
appendList(&args, strFromCString(arena, argv[i]));
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
UnixTimestamp getSystemUnixTime() {
|
||||
time_t now;
|
||||
time(&now);
|
||||
return (UnixTimestamp)now;
|
||||
}
|
||||
|
||||
Timestamp timestampFromUnixTime(UnixTimestamp *unixTimestamp) {
|
||||
tm *timestamp = gmtime((time_t *)&time);
|
||||
return *timestamp;
|
||||
}
|
||||
|
||||
string formatTimeHms(Arena *arena, UnixTimestamp time) {
|
||||
local_persist const string format = "HH-MM-SS"_s;
|
||||
string buf = PushString(arena, format.length);
|
||||
tm *timestamp = gmtime((time_t *)&time);
|
||||
strftime(buf.str, buf.length + 1, "%T", timestamp);
|
||||
return buf;
|
||||
}
|
||||
|
||||
string formatTimeHms(Arena *arena, Timestamp *time) {
|
||||
local_persist const string format = "HH-MM-SS"_s;
|
||||
string buf = PushString(arena, format.length);
|
||||
strftime(buf.str, buf.length + 1, "%T", (tm *)time);
|
||||
return buf;
|
||||
}
|
||||
|
||||
string formatTimeYmd(Arena *arena, UnixTimestamp time) {
|
||||
local_persist const string format = "YYYY-mm-dd"_s;
|
||||
string buf = PushString(arena, format.length);
|
||||
tm *timestamp = gmtime((time_t *)&time);
|
||||
strftime(buf.str, buf.length + 1, "%Y-%m-%d", timestamp);
|
||||
return buf;
|
||||
}
|
||||
|
||||
string formatTimeYmd(Arena *arena, Timestamp *time) {
|
||||
local_persist const string format = "YYYY-mm-dd"_s;
|
||||
string buf = PushString(arena, format.length);
|
||||
strftime(buf.str, buf.length + 1, "%Y-%m-%d", (tm *)time);
|
||||
return buf;
|
||||
}
|
||||
|
||||
function void __core_log(LogTarget target, const char *fmt, va_list argList) {
|
||||
Scratch scratch = scratchStart(0, 0);
|
||||
string result = strPrintfv(scratch.arena, fmt, argList);
|
||||
#if OS_WINDOWS
|
||||
DWORD done;
|
||||
HANDLE stdHandle;
|
||||
switch (target) {
|
||||
case LogTarget_stdin:
|
||||
stdHandle = GetStdHandle(STD_INPUT_HANDLE);
|
||||
break;
|
||||
case LogTarget_stdout:
|
||||
stdHandle = GetStdHandle(STD_ERROR_HANDLE);
|
||||
break;
|
||||
case LogTarget_stderr:
|
||||
stdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
break;
|
||||
default:
|
||||
stdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
break;
|
||||
}
|
||||
WriteFile(stdHandle, result.str, (DWORD)result.length, &done, 0);
|
||||
#elif OS_LINUX
|
||||
// TODO(djledda): finish implementation without cstdlib
|
||||
switch (target) {
|
||||
case LogTarget_stdin:
|
||||
write(0, (const void *)result.str, result.length);
|
||||
break;
|
||||
case LogTarget_stderr:
|
||||
fflush(stderr);
|
||||
write(2, (const void *)result.str, result.length);
|
||||
break;
|
||||
case LogTarget_stdout:
|
||||
default:
|
||||
fflush(stdout);
|
||||
write(1, (const void *)result.str, result.length);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
scratchEnd(scratch);
|
||||
}
|
||||
|
||||
void logErr(const char *fmt, ...) {
|
||||
va_list argList;
|
||||
va_start(argList, fmt);
|
||||
__core_log(LogTarget_stdout, fmt, argList);
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
function void logStdout(const char *fmt, ...) {
|
||||
va_list argList;
|
||||
va_start(argList, fmt);
|
||||
__core_log(LogTarget_stdout, fmt, argList);
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
void log(const char *fmt, ...) {
|
||||
va_list argList;
|
||||
va_start(argList, fmt);
|
||||
__core_log(LogTarget_stdout, fmt, argList);
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
void log(list<int> l, LogTarget target) {
|
||||
void (*logFn)(const char *fmt, ...) = target == LogTarget_stdout ? &logStdout : &logErr;
|
||||
logFn("{ ");
|
||||
for (size_t i = 0; i < l.length; i++) {
|
||||
if (i != 0) {
|
||||
logFn(", ");
|
||||
}
|
||||
logFn("%i", l.data[i]);
|
||||
}
|
||||
logFn(" } length: %zu, head: %zu\n", l.length, l.head);
|
||||
}
|
||||
|
||||
void log(list<string> l, LogTarget target) {
|
||||
void (*logFn)(const char *fmt, ...) = target == LogTarget_stdout ? &logStdout : &logErr;
|
||||
logFn("{ ");
|
||||
for (size_t i = 0; i < l.length; i++) {
|
||||
if (i != 0) {
|
||||
logFn(", ");
|
||||
}
|
||||
logFn("\"%S\"", l.data[i]);
|
||||
}
|
||||
logFn(" } length: %zu, head: %zu\n", l.length, l.head);
|
||||
}
|
||||
|
||||
int intCompare(const void *a, const void *b) {
|
||||
int *x = (int *)a;
|
||||
int *y = (int *)b;
|
||||
return (*x > *y) - (*x < *y);
|
||||
}
|
||||
|
||||
219
src/lib/djstdlib/core.h
Normal file
219
src/lib/djstdlib/core.h
Normal file
@@ -0,0 +1,219 @@
|
||||
#ifndef CORE_H
|
||||
#define CORE_H
|
||||
|
||||
// cstdlib includes
|
||||
#include <math.h>
|
||||
#include <stdint.h> // necessary for int type sizes
|
||||
#include <stdio.h>
|
||||
#include <time.h> // TODO(djledda): try not to depend on this one
|
||||
|
||||
// ### Misc macros ###
|
||||
#if ENABLE_ASSERT
|
||||
#define Assert(expression) if (!(expression)) {*(volatile int *)0 = 0;}
|
||||
#else
|
||||
#define Assert(expression)
|
||||
#endif
|
||||
|
||||
#define function static
|
||||
#define global static
|
||||
#define local_persist static
|
||||
|
||||
// ### Types ###
|
||||
typedef int8_t int8;
|
||||
typedef int16_t int16;
|
||||
typedef int32_t int32;
|
||||
typedef int64_t int64;
|
||||
typedef uint8_t uint8;
|
||||
typedef uint16_t uint16;
|
||||
typedef uint32_t uint32;
|
||||
typedef uint64_t uint64;
|
||||
typedef uint8_t byte;
|
||||
typedef float real32;
|
||||
typedef double real64;
|
||||
|
||||
// ### Sizes and Numbers ###
|
||||
#define Bytes(n) (n)
|
||||
#define Kilobytes(n) (n << 10)
|
||||
#define Megabytes(n) (n << 20)
|
||||
#define Gigabytes(n) (((uint64)n) << 30)
|
||||
#define Terabytes(n) (((uint64)n) << 40)
|
||||
|
||||
#define Thousand(n) ((n)*1000)
|
||||
#define Million(n) ((n)*1000000)
|
||||
#define Billion(n) ((n)*1000000000LL)
|
||||
|
||||
#define ArrayCount(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
// ### Arenas ###
|
||||
struct Arena {
|
||||
void *memory;
|
||||
size_t capacity;
|
||||
size_t head;
|
||||
};
|
||||
|
||||
struct Scratch {
|
||||
Arena *arena;
|
||||
size_t start;
|
||||
};
|
||||
|
||||
void *pushSize(Arena *arena, size_t bytes);
|
||||
Arena *arenaAlloc(size_t capacity);
|
||||
void arenaFree(Arena *arena);
|
||||
void arenaFreeFrom(Arena *arena, size_t pos);
|
||||
|
||||
void initialiseCore();
|
||||
|
||||
Scratch scratchStart(Arena **conflicts, size_t conflictCount);
|
||||
void scratchEnd(Scratch scratch);
|
||||
|
||||
#define PushArray(arena, type, size) (type *)pushSize(arena, sizeof(type) * (size))
|
||||
#define PushStruct(arena, type) (type *)pushSize(arena, sizeof(type))
|
||||
|
||||
// ### Vectors ###
|
||||
template <typename T>
|
||||
union Vector2 {
|
||||
struct {
|
||||
T x;
|
||||
T y;
|
||||
};
|
||||
T vec[2];
|
||||
};
|
||||
template <typename T>
|
||||
inline function Vector2<T> vec2(T x, T y) {
|
||||
Vector2<T> result = {0};
|
||||
result.x = x;
|
||||
result.y = y;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
union Vector3 {
|
||||
struct {
|
||||
T x;
|
||||
T y;
|
||||
T z;
|
||||
};
|
||||
T vec[3];
|
||||
};
|
||||
template <typename T>
|
||||
inline function Vector3<T> vec3(T x, T y, T z) {
|
||||
Vector3<T> result = {0};
|
||||
result.x = x;
|
||||
result.y = y;
|
||||
result.z = z;
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
union Vector4 {
|
||||
struct {
|
||||
T x;
|
||||
T y;
|
||||
T z;
|
||||
T w;
|
||||
};
|
||||
T vec[4];
|
||||
};
|
||||
template <typename T>
|
||||
inline function Vector4<T> vec4(T x, T y, T z, T w) {
|
||||
Vector4<T> result = {0};
|
||||
result.x = x;
|
||||
result.y = y;
|
||||
result.z = z;
|
||||
result.w = w;
|
||||
return result;
|
||||
}
|
||||
|
||||
// ### Lists ###
|
||||
template <typename T>
|
||||
struct list {
|
||||
T* data;
|
||||
size_t length;
|
||||
size_t head;
|
||||
};
|
||||
|
||||
#define PushList(arena, type, size) (list<type>{ PushArray(arena, type, size), size, 0 })
|
||||
#define PushFullList(arena, type, size) (list<type>{ PushArray(arena, type, size), size, size })
|
||||
|
||||
template <typename T> T *appendList(list<T> *list, T element);
|
||||
template <typename T> void zeroList(list<T> *list);
|
||||
template <typename T> void zeroListFull(list<T> *list);
|
||||
template <typename T> list<T> listSlice(list<T> l, size_t start, size_t stop = 0);
|
||||
|
||||
// ### Strings ###
|
||||
struct string {
|
||||
char *str;
|
||||
size_t length;
|
||||
};
|
||||
#define STB_SPRINTF_DECORATE(name) stb_##name // define this before including if you want to change the names
|
||||
#include "vendor/stb_sprintf.h"
|
||||
|
||||
#define strlit(lit) (string{(char *)(lit), sizeof(lit) - 1})
|
||||
#define PushString(arena, length) (string{ (char *)pushSize(arena, length), (length) })
|
||||
string operator""_s(const char *cstrLiteral, unsigned long length);
|
||||
|
||||
// C Strings
|
||||
const char *cstring(Arena *arena, list<char> buf);
|
||||
const char *cstring(Arena *arena, string str);
|
||||
size_t calcStringLen(const char *str);
|
||||
string strFromCString(Arena *arena, const char *str);
|
||||
|
||||
bool strEql(string s1, string s2);
|
||||
bool stringContains(string str, char c);
|
||||
|
||||
string strReverse(Arena *arena, string str);
|
||||
string strSlice(string str, size_t start, size_t stop = 0);
|
||||
string strSlice(char *data, size_t start, size_t stop = 0);
|
||||
list<string> strSplit(Arena *arena, string splitStr, string inputStr);
|
||||
string strPrintfv(Arena *arena, const char *fmt, va_list args);
|
||||
string strPrintf(Arena *arena, const char *fmt, ...);
|
||||
|
||||
int8 parsePositiveInt(string str, size_t *lengthPointer);
|
||||
real32 parsePositiveReal32(Arena *arena, string str, size_t *lengthPointer);
|
||||
|
||||
inline function bool isNumeric(char c);
|
||||
|
||||
// ### File IO ###
|
||||
string readEntireFile(Arena *arena, string filename);
|
||||
bool writeEntireFile(Arena *arena, string filename, const byte *contents, size_t contentsLength);
|
||||
bool fileAppend(Arena *arena, string filename, const byte *contents, size_t contentsLength);
|
||||
|
||||
// ### Cmdline ###
|
||||
list<string> getArgs(Arena *arena, int argc, char **argv);
|
||||
|
||||
// ### Time ###
|
||||
typedef uint64 UnixTimestamp;
|
||||
typedef tm Timestamp;
|
||||
|
||||
UnixTimestamp getSystemUnixTime();
|
||||
Timestamp timestampFromUnixTime(UnixTimestamp *unixTimestamp);
|
||||
string formatTimeHms(Arena *arena, UnixTimestamp time);
|
||||
string formatTimeHms(Arena *arena, Timestamp *time);
|
||||
string formatTimeYmd(Arena *arena, UnixTimestamp time);
|
||||
string formatTimeYmd(Arena *arena, Timestamp *time);
|
||||
|
||||
// ### Linked Lists ###
|
||||
// TODO(djledda): implement basic linked lists (based on arenas?)
|
||||
|
||||
// ### Logging ###
|
||||
enum LogTarget {
|
||||
LogTarget_stdout,
|
||||
LogTarget_stdin,
|
||||
LogTarget_stderr,
|
||||
LogTarget_count,
|
||||
};
|
||||
|
||||
void log(list<int> l, LogTarget target = LogTarget_stdout);
|
||||
void log(list<string> l, LogTarget target = LogTarget_stdout);
|
||||
void log(const char *fmt, ...);
|
||||
void logError(const char *fmt, ...);
|
||||
|
||||
// ### Loops ###
|
||||
#define EachIn(list, it) size_t it = 0; it < list.length; it++
|
||||
#define EachInReversed(list, it) size_t it = list.length - 1; it >= 0 && it < list.length; it--
|
||||
#define EachInArray(arr, it) size_t it = 0; it < ArrayCount(arr); ++it
|
||||
|
||||
// ### Misc ###
|
||||
int intCompare(const void *a, const void *b);
|
||||
|
||||
#endif
|
||||
12
src/lib/djstdlib/os.cpp
Normal file
12
src/lib/djstdlib/os.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef OS_CPP
|
||||
#define OS_CPP
|
||||
|
||||
#if OS_WINDOWS
|
||||
#include "os_win32.cpp"
|
||||
#elif OS_LINUX
|
||||
#include "os_linux.cpp"
|
||||
#else
|
||||
#error Development environment not supported.
|
||||
#endif
|
||||
|
||||
#endif
|
||||
12
src/lib/djstdlib/os.h
Normal file
12
src/lib/djstdlib/os.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef OS_H
|
||||
#define OS_H
|
||||
|
||||
#include "core.h"
|
||||
|
||||
// ### Memory ###
|
||||
void *os_alloc(size_t capacity);
|
||||
void os_reserve(void *ptr);
|
||||
void os_decommit(void *ptr);
|
||||
void os_free(void *ptr, size_t freeSize);
|
||||
|
||||
#endif
|
||||
24
src/lib/djstdlib/os_linux.cpp
Normal file
24
src/lib/djstdlib/os_linux.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef OS_IMPL_LINUX_CPP
|
||||
#define OS_IMPL_LINUX_CPP
|
||||
|
||||
#include "os.h"
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
void *os_alloc(size_t capacity) {
|
||||
return mmap(0, capacity, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
}
|
||||
|
||||
void os_commit(void *ptr) {
|
||||
}
|
||||
|
||||
void os_decommit(void *ptr) {
|
||||
}
|
||||
|
||||
void os_free(void *ptr, size_t size) {
|
||||
int err = munmap(ptr, size);
|
||||
Assert(err != -1);
|
||||
}
|
||||
|
||||
#endif
|
||||
21
src/lib/djstdlib/os_win32.cpp
Normal file
21
src/lib/djstdlib/os_win32.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef OS_IMPL_WIN32_CPP
|
||||
#define OS_IMPL_WIN32_CPP
|
||||
|
||||
#include "os.h"
|
||||
#include "Windows.h"
|
||||
|
||||
void *os_alloc(size_t commitSize) {
|
||||
return VirtualAlloc(NULL, commitSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
|
||||
}
|
||||
|
||||
void os_reserve(void *ptr) {
|
||||
}
|
||||
|
||||
void os_decommit(void *ptr) {
|
||||
}
|
||||
|
||||
void os_free(void *ptr, size_t size) {
|
||||
VirtualFree(ptr, NULL, MEM_RELEASE);
|
||||
}
|
||||
|
||||
#endif
|
||||
1923
src/lib/djstdlib/vendor/stb_sprintf.h
vendored
Normal file
1923
src/lib/djstdlib/vendor/stb_sprintf.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1833
src/lib/glad/glad.c
Normal file
1833
src/lib/glad/glad.c
Normal file
File diff suppressed because it is too large
Load Diff
3694
src/lib/glad/glad.h
Normal file
3694
src/lib/glad/glad.h
Normal file
File diff suppressed because it is too large
Load Diff
7898
src/lib/loaders/stb_image.h
Normal file
7898
src/lib/loaders/stb_image.h
Normal file
File diff suppressed because it is too large
Load Diff
1739
src/lib/loaders/tinyobj.h
Normal file
1739
src/lib/loaders/tinyobj.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user