Jump to content

Furbolg

Members
  • Posts

    243
  • Joined

  • Last visited

Everything posted by Furbolg

  1. Hi again, sorry i was just focusing the error, of course smashthewindow and roland are right. A namespace makes more sense in this case.
  2. 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
  3. 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 ?
  4. As i said above, depends on the engine architecture
  5. 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.
  6. Whats the problem ? Since the iterator is created on stack, you can just create new instance when you need it.
  7. You do it wrong. 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.
  8. 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.
  9. 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() { }
  10. 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.
  11. 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; }
  12. I can only suggest to use the MSDN (msdn.microsoft.com) The MSDN says under "Remarks" the following: http://msdn.microsof...ibrary/fe72hft9
  13. But its worth every dollar, just the better syntax highlighting and there are soo much awesome featues. You are a lucky one
  14. Jea Visual Assist (X) rocks, just don't do the same error as me, buy the standard license not the personal license.
  15. Maybe Josh should pay us or give us rabatte on LE3D **disclaimer: this statement was meant to be funny / joke **
  16. 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**
  17. 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.
  18. 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.
  19. 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.
  20. Can you get me iPhone 5 Prototype ?
  21. I got a iPhone and i know that iPad and iPhone have no difference in software. The only difference is the bigger display, they even use the same SoC (arm a9 i think).
  22. Your chart is very subjective.... iPhone and iPad use the iOS so there is no difference. *edit* I read this forum a while, i know some of his facts, opinions and charts
  23. Jea but the first version of LE3D is the first version, there cant be second first version unless you create a wormhole and travel back in time
×
×
  • Create New...