-
Posts
164 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Blog Comments posted by ArBuZ
-
-
I think static methods is a good way to go. I think constructor doesn't control memory allocation of the object itself. The compiler with the "new" command does it.
All, that work with pointers must work with objects. I mean both:
Mesh* meshObj=new Mesh("mesh.gmf"); Mesh meshObj("mesh.gmf");
must work. But with the exceptions you can not use second line, right?
It will be similar with what Roland suggested
KittenFactory fact; Kitten* k = fact.CreateFluffy()
But factory will be encapsulated in the class.
Kitten* k=Kitten::CreateFluffy();
That is only my thoughts. I'm not as good in programing as you guys.
[Edit] Damn I type too slow. Two more posts are made
-
Isn't Shader an abstract class? And OpenGLShader is it's extension? How can constructor return different types?
-
Maybe you should place all Create/Load methods in classes as static methods.
For example:
Model* myModel=Model::LoadModel("myModel.gmf"); Shader* myShader=Shader::LoadShader();
And this static functions could return NULL or object itself.
And in LoadShader() function you can decide what exactly type of shader to return
-
So, if we have 10 models to load we will need write try/catch 10 times for each model, right?
-
But how will you bake try/catch in to the engine? As I understand its talked about our (customer) side of programming.
-
Josh thank you very much for this link!!!! I hate all that new win7 stuff. I cant work in it!!! I have a feeling that Microsoft intentionally made madman UI design. Every time I start working in win7 I go mad and angry. Damn
Some sample LE3 code
in Development Blog
A blog by Josh in General
Posted
I can not even try to argue with you because you are by a lot of heads taller than me in programming
I just thought that Shader is a base class. And OpenGLShader and maybe DirectXShader are derived classes.
But as I understand
allays returns Shader object and it can not return any other derived type. That what I meant.