This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AE.h" | |
typedef struct{ | |
AEStringHashTable(AETexture) textures; | |
}ResourceManager; | |
void ResourceManagerInit(ResourceManager* self); | |
void ResourceManagerDeinit(ResourceManager* self); | |
AETexture ResourceManagerLookup(ResourceManager* self, const char* filename); | |
void ResourceManagerRemove(ResourceManager* self, const char* filename); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init: func ~withAllArgs(=ano, =mes, =dia){} | |
init: func (ano := 2011, mes := 1, dia := 1) { | |
init~withAllArgs(ano, mes, dia) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Triangulated Mesh Editing Utility | |
#pragma once | |
#include "AE.h" | |
typedef struct AEMesh AEMesh; | |
typedef struct AEMeshVertex AEMeshVertex; | |
typedef struct AEMeshTriangle AEMeshTriangle; | |
typedef enum{ | |
AEMeshTypeTriangles, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UI : NSObject { | |
AEVec2 windowSize; | |
UIFont* font; | |
AEVec2 mouse; | |
struct{ | |
char left, middle, right, upwheel, downwheel; | |
}mouseButtons; | |
AETable* cache; | |
struct{ | |
AETextBuffer* textBuffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AEArray(int) ints; | |
AEArrayInit(&ints); | |
AEArrayAdd(&ints, 1); | |
AEArrayAdd(&ints, 2); | |
AEArrayAdd(&ints, 3); | |
for(size_t i=0; i<AEArrayLength(&ints); i++) | |
printf("At Index %lu, we have %i\n", (unsigned long)i, AEArrayAsCArray(&ints)[i]); | |
AEArrayDeinit(&ints); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Platform Independent Endian Converter | |
Copyright (c) 2010 Oliver Daids | |
3-clause BSD | |
Note: This was not designed for speed, nor cleanliness, it was just a quick experiment to see if I could get a platform independent endian converter. | |
*/ | |
#include <stdint.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vec3: class{ | |
x, y, z: Float | |
allocWith: static func(allocator: Func(SizeT)->Pointer) -> This{ | |
object := allocator(Vec3 as Class instanceSize) as This | |
if(object) object class = This | |
return object | |
} | |
init: func(=x,=y,=z) -> This { this } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/opt/rock/sdk/threading/native/MutexUnix.ooc: In function ‘threading_native_MutexUnix__MutexUnix_new’: | |
/opt/rock/sdk/threading/native/MutexUnix.ooc:32: error: ‘__SIZEOF_PTHREAD_MUTEX_T’ undeclared (first use in this function) | |
/opt/rock/sdk/threading/native/MutexUnix.ooc:32: error: (Each undeclared identifier is reported only once | |
/opt/rock/sdk/threading/native/MutexUnix.ooc:32: error: for each function it appears in.) | |
/opt/rock/sdk/threading/native/MutexUnix.ooc: In function ‘threading_native_MutexUnix__RecursiveMutexUnix_new’: | |
/opt/rock/sdk/threading/native/MutexUnix.ooc:54: error: ‘__SIZEOF_PTHREAD_MUTEX_T’ undeclared (first use in this function) | |
C compiler failed (with code 1), aborting compilation process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dereferenceIntPointer: func(pointer: Int*, jmpbufstate: JmpBuf){ | |
if(pointer==NULL) jmpbufstate restore(Exception new("Woah dude, assign your pointers!")) | |
return pointer@ | |
} | |
try(|state| | |
i = 0 : Int | |
printf("%i\n",dereferenceIntPointer(i&,state)) | |
)//Returns an Exception | |
catch(Exception /*The class that this catch will catch*/,|exception,stateForRethrowing| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dereferenceIntPointer: func(pointer: Int*, jmpbufstate: JmpBuf){ | |
if(pointer==NULL) jmpbufstate restore(Exception new("Woah dude, assign your pointers!")) | |
return pointer@ | |
} | |
try(|state| | |
i = 0 : Int | |
printf("%i\n",dereferenceIntPointer(i&,state)) | |
)//Returns an Exception | |
catch(Exception /*The class that this catch will catch*/,|exception,stateForRethrowing| |