Since i gave up on the beta5 to get to work, i'm trying to get my own little program to work with beta4(it works for my needs anyway), so basically what this program is about,im trying to wrapp the Horde3d engine into a dll with custom functions, basically im experimenting on how to write a small wrapped dev engine? with horde powered graphics and some physics lib, but first id like to get atleast a hello world example to work. So i think this is where my n00bness in c++ comes in, my experience in c++ stands in physics engines, and gfx engine structure is a bit more advance imo, so Horde3d seemed to be a pretty cool place where to start. Basically It would be a wrapper and every language that suports API calls should be able to run it.
Anyway I'm trying to write attleast 5 functions to get it all working, but i dont know if i should wrap the engine straight from source(witch imo seems to be the best way, but needs a bit deeper look into the engines structure), or i should wrap the dll's, or i should just basically write my own bindings(but id really like to write custom functions etc. For example a Function that Includes the main initialization.
Anyway writing these functions is not a problem, but writing them in a way that i could use them more than once is a bit over head for me right now, because i dont know if functions in h3d have classes, withc would be simpler to me. or i shoudl add classes, witch i dont quite understand yet, anyway, im trying to get these functions to work
Create3DDevice() - this would initialize horde3d
CreateCamera() - prety self explaining
LoadAMesh() - or if possible CreateAPrimitive(), just something to render
DisplayText() - to display something like "Hello World"
RenderScene() - just to render the whole thing in Horde3D
Well first everything was running smoothly, after i Created The Camera function, since there can be more cameras than one, and there can be more camera recourses also, so im not quite sure how to define/class or whatever it etc
Im sorry if this is a wery stupid thread, but this is what i would liek to do with Horde3D
Right now my not workin code looks like this:
Code:
// horde includes
#include <Horde3D.h>
#include <Horde3DUtils.h>
H3DNode cam = 0;
H3DRes pipeRes = 0;
// Define Function Exports
#define EXPORT extern "C" __declspec(dllexport)
#define MYCALL _stdcall
//Exported functions
EXPORT void MYCALL Create3DDevice ( int winWidth, int winHeight)
{
// Initialize Horde3D engine
h3dInit();
h3dSetupViewport( 0, 0, winWidth, winHeight, true );
// Add pipeline resource
H3DRes pipeRes = h3dAddResource( H3DResTypes::Pipeline, "standard.pipeline.xml", 0 );
// Load added resources
h3dutLoadResourcesFromDisk( "" );
}
EXPORT H3DNode MYCALL CreateCamera ( NodeHandle ParentNode)
{
// Add camera
H3DNode cam = h3dAddCameraNode( ParentNode, "Camera", pipeRes );
return cam;
}
EXPORT void MYCALL RenderScene ( NodeHandle cam)
{
// Render scene
h3dRender( cam );
// Finish rendering of frame
h3dFinalizeFrame();
}
What do i need to add to get those functions working, is my aproach correct(i think not), should i quit C++ lol
anyway if there is a nice friendly persoun out there, maybe he can help a stupid guy like me, because id really like to learn and do this.