Example Input
Example GameLoop.hpp:
GMEXPORT double gameLoopInit(char* program_directory);
GMEXPORT double gameLoopStep();
GMEXPORT double gameLoopDraw();
Example gameMakerFunctions3円DGraphics\d3d_model.hpp:
double d3d_model_create();
void d3d_model_destroy(double ind);
void d3d_model_load(double ind, const char* fname);
void d3d_model_draw(double ind, double x, double y, double z, double texid);
void d3d_model_primitive_begin(double ind, double kind);
void d3d_model_vertex_texture(double ind, double x, double y, double z, double xtex, double ytex);
void d3d_model_primitive_end(double ind);
Example Output
Example GetGameLoop.hpp:
GMEXPORT double get_gameLoopInit()
{
return (double)(int)gameLoopInit;
}
GMEXPORT double get_gameLoopStep()
{
return (double)(int)gameLoopStep;
}
GMEXPORT double get_gameLoopDraw()
{
return (double)(int)gameLoopDraw;
}
Example callGameLoop.hpp:
if (function_to_call == (void*)gameLoopInit)
function_return_value = gameLoopInit(dll_input[0].text);
if (function_to_call == (void*)gameLoopStep)
function_return_value = gameLoopStep();
if (function_to_call == (void*)gameLoopDraw)
function_return_value = gameLoopDraw();
Example gameMakerGenLibrary.hpp:
ADD_FUNCTION(d3d_model_create)
double d3d_model_create()
{
return addDelayedFunctionCall(FP_d3d_model_create, 1);
}
ADD_FUNCTION(d3d_model_destroy)
void d3d_model_destroy(double input0)
{
addDelayedFunctionCall(FP_d3d_model_destroy, 0, input0);
}
ADD_FUNCTION(d3d_model_load)
void d3d_model_load(double input0, const char* input1, const char* input2)
{
addDelayedFunctionCall(FP_d3d_model_load, 0, input0, input1, input2);
}
ADD_FUNCTION(d3d_model_draw)
void d3d_model_draw(double input0, double input1, double input2, double input3, double input4)
{
addDelayedFunctionCall(FP_d3d_model_draw, 0, input0, input1, input2, input3, input4);
}
ADD_FUNCTION(d3d_model_primitive_begin)
void d3d_model_primitive_begin(double input0, double input1)
{
addDelayedFunctionCall(FP_d3d_model_primitive_begin, 0, input0, input1);
}
ADD_FUNCTION(d3d_model_vertex_texture)
void d3d_model_vertex_texture(double input0, double input1, double input2, double input3, double input4, double input5)
{
addDelayedFunctionCall(FP_d3d_model_vertex_texture, 0, input0, input1, input2, input3, input4, input5);
}
ADD_FUNCTION(d3d_model_primitive_end)
void d3d_model_primitive_end(double input0)
{
addDelayedFunctionCall(FP_d3d_model_primitive_end, 0, input0);
}
Assume that any files not included are either empty or nothing but whitespace. I didn't design for files to be omitted, but the other "gameMakerFunctions*.hpp" headers are utilized identically.
Example Input
Example GameLoop.hpp:
GMEXPORT double gameLoopInit(char* program_directory);
GMEXPORT double gameLoopStep();
GMEXPORT double gameLoopDraw();
Example gameMakerFunctions3円DGraphics\d3d_model.hpp:
double d3d_model_create();
void d3d_model_destroy(double ind);
void d3d_model_load(double ind, const char* fname);
void d3d_model_draw(double ind, double x, double y, double z, double texid);
void d3d_model_primitive_begin(double ind, double kind);
void d3d_model_vertex_texture(double ind, double x, double y, double z, double xtex, double ytex);
void d3d_model_primitive_end(double ind);
Example Output
Example GetGameLoop.hpp:
GMEXPORT double get_gameLoopInit()
{
return (double)(int)gameLoopInit;
}
GMEXPORT double get_gameLoopStep()
{
return (double)(int)gameLoopStep;
}
GMEXPORT double get_gameLoopDraw()
{
return (double)(int)gameLoopDraw;
}
Example callGameLoop.hpp:
if (function_to_call == (void*)gameLoopInit)
function_return_value = gameLoopInit(dll_input[0].text);
if (function_to_call == (void*)gameLoopStep)
function_return_value = gameLoopStep();
if (function_to_call == (void*)gameLoopDraw)
function_return_value = gameLoopDraw();
Example gameMakerGenLibrary.hpp:
ADD_FUNCTION(d3d_model_create)
double d3d_model_create()
{
return addDelayedFunctionCall(FP_d3d_model_create, 1);
}
ADD_FUNCTION(d3d_model_destroy)
void d3d_model_destroy(double input0)
{
addDelayedFunctionCall(FP_d3d_model_destroy, 0, input0);
}
ADD_FUNCTION(d3d_model_load)
void d3d_model_load(double input0, const char* input1, const char* input2)
{
addDelayedFunctionCall(FP_d3d_model_load, 0, input0, input1, input2);
}
ADD_FUNCTION(d3d_model_draw)
void d3d_model_draw(double input0, double input1, double input2, double input3, double input4)
{
addDelayedFunctionCall(FP_d3d_model_draw, 0, input0, input1, input2, input3, input4);
}
ADD_FUNCTION(d3d_model_primitive_begin)
void d3d_model_primitive_begin(double input0, double input1)
{
addDelayedFunctionCall(FP_d3d_model_primitive_begin, 0, input0, input1);
}
ADD_FUNCTION(d3d_model_vertex_texture)
void d3d_model_vertex_texture(double input0, double input1, double input2, double input3, double input4, double input5)
{
addDelayedFunctionCall(FP_d3d_model_vertex_texture, 0, input0, input1, input2, input3, input4, input5);
}
ADD_FUNCTION(d3d_model_primitive_end)
void d3d_model_primitive_end(double input0)
{
addDelayedFunctionCall(FP_d3d_model_primitive_end, 0, input0);
}
Assume that any files not included are either empty or nothing but whitespace. I didn't design for files to be omitted, but the other "gameMakerFunctions*.hpp" headers are utilized identically.
To solve this problem I wrote a program called "dynamicWrapperGeneration.cpp"c" that when ran parses various headers that used to contain all that boilerplate but now contain nothing but function declarations. It then generates the needed boilerplate files. This file specifically is the one I would like reviewed.
To solve this problem I wrote a program called "dynamicWrapperGeneration.cpp" that when ran parses various headers that used to contain all that boilerplate but now contain nothing but function declarations. It then generates the needed boilerplate files. This file specifically is the one I would like reviewed.
To solve this problem I wrote a program called "dynamicWrapperGeneration.c" that when ran parses various headers that used to contain all that boilerplate but now contain nothing but function declarations. It then generates the needed boilerplate files. This file specifically is the one I would like reviewed.