Hey Guys,
So I am working on converting my engine to a library to simplify the process of making new games, and hopefully to use it to hook into a Game Editor as done in the book.
I found I had to do alot of changes, especially adding alot of abstract interfaces as base classes, this allows me to be able to completely seperate a game project from the 3rd parts librarys, otherwise they will be trying to include things like tinyXML, Zlib, etc.
I have run into some cases though for instance in my IActorComponent, where it uses TinyXML and in the VInit function uses a TiXmlElement pointer, this won't do as my desire is to keep the user from having to lug around the 3rd party lib's.
I chose to use a void pointer, everything works fine and I cast to a TiXmlElement pointer on the source file side, I just wanted to run this by someone else to be sure I am not doing something unsafe.
To my knowledge, using void pointers is OK as long as you are vigilant at not passing the wrong type in.
So I am working on converting my engine to a library to simplify the process of making new games, and hopefully to use it to hook into a Game Editor as done in the book.
I found I had to do alot of changes, especially adding alot of abstract interfaces as base classes, this allows me to be able to completely seperate a game project from the 3rd parts librarys, otherwise they will be trying to include things like tinyXML, Zlib, etc.
I have run into some cases though for instance in my IActorComponent, where it uses TinyXML and in the VInit function uses a TiXmlElement pointer, this won't do as my desire is to keep the user from having to lug around the 3rd party lib's.
I chose to use a void pointer, everything works fine and I cast to a TiXmlElement pointer on the source file side, I just wanted to run this by someone else to be sure I am not doing something unsafe.
To my knowledge, using void pointers is OK as long as you are vigilant at not passing the wrong type in.
PC - Custom Built
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz