start checking all instance functions

This commit is contained in:
Greg Wells
2025-06-27 21:22:05 -04:00
parent f98dc5fead
commit 502634770e
10 changed files with 205 additions and 16 deletions

View File

@@ -35,7 +35,7 @@ typedef enum gnDebuggerLayer {
} gnDebuggerLayer;
typedef struct gnDebuggerInfo {
gnDebuggerCallback callback;
gnDebuggerCallback callback; // instance callback cannot be null
void* userData;
uint32_t layerCount;

View File

@@ -8,13 +8,23 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceInfo info) {
(*instance)->layers = loaderLayerArrayListCreate();
// load the API layers (this will)
loaderInfo loadInfo = {
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){
.api = info.renderingAPI,
.layerToLoad = api_layer
};
}));
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer(loadInfo));
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){
.api = info.renderingAPI,
.layerToLoad = function_checker_layer
}));
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){
.api = info.renderingAPI,
.layerToLoad = function_checker_layer
}));
(*instance)->currentLayer = ((*instance)->layers.count - 1);
for (int i = 0; i < (*instance)->layers.count; i++) (*instance)->layers.data[i].layerIndex = i;
// i hate this line of code but im not fixing it
(*instance)->callingLayer = &(*instance)->layers.data[(*instance)->layers.count - 1];

View File

@@ -23,6 +23,7 @@ struct gnInstance_t {
loaderLayerArrayList layers;
loaderLayer* callingLayer;
uint32_t currentLayer;
gnDebuggerHandle debugger;
};