-
Posts
243 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Furbolg
-
-
Hi Aggror,
in the h. file you use: vector<resolution*> and in the cpp. file you use vector<resolution> thats a difference
-
Ah ok, my fault, i thought updating newton would be enaugh.
Then release LE3D soon
-
Hi Guys!
It has soft bodies, destruction, and scaling now, so I am pretty happy.
So could you make an update for Leadwerks 2.5 to support scaling (in Sandbox) again ?
Because i think scaling with a external program is not a solution - its a workaround.
(And besides the major competitors have scaling (unity, unreal, cryengine etc.))
-
Could you show us the Defination and Implementation of Print ?
-
Hi again,
sorry i was just focusing the error, of course smashthewindow and roland are right.
A namespace makes more sense in this case.
-
Hey Aggror!
1. You forget a closing bracket at the end.
2. All Methods and Variables declared without a specific access space are default in private (opposite to struct where all entires automatically public)
So your working class look like this:
#include <sstream> class Convert { public: template <class T> static inline std::string ToString (const T& t) { std::stringstream ss; ss << t; return ss.str(); } };
Simple Test code from me:
#include <windows.h> #include <iostream> #include <stdio.h> #include "convert.h" int main(int argc, char** argv) { int a = 12345; float b = 54321.0f; std::cout << Convert::ToString<int>(a) << std::endl; std::cout << Convert::ToString<float>(B) << std::endl; system("pause"); return 0; }
Cheers
-
Seperate your Loading from your Scene.
For example make a Loading Function which loads all data needed and in the beginning you can setup a Loading Screen, after the Loading Function is ready (returns) you can disable the Loading screen.
Would this help ?
-
Benton just means that the less limbs per render is better for fps. Meaning, if you can group several objects together that share only one limb, then this will have less effect on framerate. More limbs means slower framerate. So, it depends on your case, and what you want to achieve.
Anyways, nice wall, Roland!
Cheers
As i said above, depends on the engine architecture
-
Theoretically it doesnt matter if you use 4 models or 1 model... it depends how the engine works internally.
Drawcall is "a function" which gives the drawing information (vertices, textures, shader etc...) to the graphics driver, the count of drawcalls should be as small as possible (its the engine's job to collect them and draw them together).
Todays graphics card can render a whole bunch of polygons (10.000+) but cant handle much drawcalls.
-
That's somewhat better, but I still don't like this because you always have to have the list and the iterator. Why can't the iterator just remember which list it belongs to?
Whats the problem ? Since the iterator is created on stack, you can just create new instance when you need it.
- 1
-
You do it wrong.
With STL iterators, you have no idea whether an iterator is valid or not:
std::list<Object*>::iterator it = list.begin(); list.erase(it); //it still hangs around, can't be changed to NULL
Do it like this: (MSDN: std::list.erase http://msdn.microsoft.com/en-us/library/1fef72t6%28v=vs.80%29.aspx )
std::list<Object*> list; list.push_back(new Object()); std::list<Object*>::iterator it = list.begin(); it = list.erase(it); if (it == list.end()) // similiar to == null { std::cout << "no more entry" << std::endl; }
ps. Im sorry to refer so much to the MSDN but its the best source for (v)c++ documentation.
-
Please dont say Performance
For Release Mode you can write this :
#define _SECURE_SCL 0
Which turns off checks (http://msdn.microsoft.com/en-us/library/aa985965%28v=vs.80%29.aspx) within the iterators (range, null etc.) but just do it on your own risk.
-
Should work like this : (from MSDN, i only recommend using the MSDN http://msdn.microsoft.com/en-us/library/ffef594x%28v=vs.80%29.aspx )
// class_templates.cpp template <class T, int i> class TempClass { public: TempClass( void ); ~TempClass( void ); int MemberSet( T a, int b ); private: T Tarray[i]; int arraysize; }; int main() { }
-
You meaning detail maps ? http://www.cafu.de/wiki/textures:perfect_detail_maps
If yes then i think its just a second textures which is blended multiplytive above the first one.
-
Awesome, thanks Roland
-
The default value of an pointer is undefined (in release mode).
prove
#include <windows.h> #include <iostream> #include <stdio.h> int main(int argc, char** argv) { int* test; int* test2 = NULL; std::cout << test << std::endl; std::cout << test2 << std::endl; system("pause"); return 0; }
-
***************************************
IMPORTANT
***************************************
It seems Roland is right. Well, sometimes. I am getting unreliable behavior when reading with the [] operator, if the key does not exist in the map. I recommend always using find() instead of the [] operator!
I can only suggest to use the MSDN (msdn.microsoft.com)
The MSDN says under "Remarks" the following:
http://msdn.microsof...ibrary/fe72hft9
If the argument key value is not found, then it is inserted along with the default value of the data type.
operator[] may be used to insert elements into a map m using m[_Key] = DataValue; where DataValue is the value of the mapped_type of the element with a key value of _Key.
When using operator[] to insert elements, the returned reference does not indicate whether an insertion is changing a pre-existing element or creating a new one. The member functions find and insert can be used to determine whether an element with a specified key is already present before an insertion.
-
Yeah that one is great, but 249$... ouch
But its worth every dollar, just the better syntax highlighting and there are soo much awesome featues.
i am happy as i can buy it as academic license
You are a lucky one
-
Jea Visual Assist (X) rocks, just don't do the same error as me, buy the standard license not the personal license.
-
Maybe Josh should pay us or give us rabatte on LE3D **disclaimer: this statement was meant to be funny / joke **
-
Josh as you declared your std::list on the stack it should.. no must.. be cleaned up after leaving the scope.
Are you sure your System::GetMemoryUsage() works correctly ?
To verify it, please check your Ressourcemonitor on the RAM Tab.
**edit**
-
Virtual isn't just a "placeholder" or "template" and it can (but has not to) be overridden.
In my opinion, the strength of virtual methods is that you can decide which method to use (base, derived) or to define that an specific method has to be implemented by user ( = 0 ). And you can also hide informations from the user.
For example my actual engine iteration has something like this: (pseudo code, does not compile)
class IRenderDevice { public: virtual void Initialise(u16 Width, u16 Height, u8 Bits) = 0; virtual void Draw(...) = 0; virtual void Terminate() = 0; }; class D3D9RenderDevice : public IRenderDevice { private: //some dx9 vars LPDIRECT3D9* d3d9; LPDIRECT3DDEVICE9* d3d9device; public: virtual void Initialise(u16 Width, u16 Height, u8 Bits); virtual void Draw(...); virtual void Terminate(); };
And this is how to use it:
int main(int argc, char** argv) { IRenderDevice* mydevice = new D3D9Device(); mydevice->Initialise(800,600,32); // mainloop while(true) { mydevice->Draw(.....); } mydevice->Terminate(); };
So whats the advantage of this ? I just change "new D3D9Device();" with "new OpenGL33Device();" and it uses OpenGL 3.3.
To be honest, this is not the full implementation and style but you should get the idea behind this
In my real code the instances are created by a core class (you can call it factory) and the user of the "engine" has no worries but using directx / opengl by himself. He just uses my interface and classes i provide him.
Of course he could write his own RenderDevice by inheritancing my IRenderDevice and create an instance by himself "new myogrerenderer();" etc.
-
Here is a link, there are some tests about how "slow" virtual functions really are.
http://stackoverflow.com/questions/449827/virtual-functions-and-performance-c
On modern CPUs its so fast that you will "feel" a difference at round about 1 million calls.
You can create a whole engine with virtual functions (which is good to hide implementation specific details but i won't write all with virtual functions for example vector3 or matrix etc.) and its run without problems, because to load/draw a model is much (very much) slower then calling virtual functions.
-
You also can use assembler which is even faster.... listen to Roland, thats the right way. Metatron is right about speed but its not that big impact like he did like to tell you.
Template in a std::map ??
in Programming
Posted
You cant do nothing here.
Because templates are not "dynamic Type", Templates are "choosen Type".
For example:
What you "can" do here right now is using interfaces and inheritance for example:
This is just a small example without const correctness and some other design patterns (observer, visitor, factory ....) but i hope this is an idea for you.