- Viewing Profile: Reputation: Rene Z
Community Stats
- Group Members
- Active Posts 99
- Profile Views 1,247
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Contacts
Rene Z hasn't added any contacts yet.
#4963106 Draging a map in directx
Posted by Rene Z
on 25 July 2012 - 05:49 PM
If you're using a perspective projection this won't work, so let me know if that's the case.
#4950038 Overusing smart pointers?
Posted by Rene Z
on 17 June 2012 - 10:02 AM
I always use smart pointers, unless there's a good reason not to. A good reason can be performance in tight loops or something like that, but those cases are rare and should never leak out of your interfaces. Note that using smart pointers doesn't mean 'don't think about ownership', which often results in overusing shared pointers. Quite the opposite in fact: different types of smart pointers are a great way to explicitly state ownership of an object.
#4922293 link 2005 error in project
Posted by Rene Z
on 15 March 2012 - 09:31 AM
Now some (constructive!) criticism towards your code:
Why does your FPSCamera class use those global variables? Only use globals when you absolutely have to, or they will come back to bite you in the behind. In this case, camX ect. should be members of the FPSCamera class. Remove the globals in main.cpp too.
Pi is indeed a good candidate for a const global, but doesn't belong in Camera.h. Ask yourself this: you need Pi for some calculations, does it make sense if you have to include Camera.h?
Camera.h includes main.h. Why? Has the camera a dependency on main? Include as little as possible in the header. In this case, you don't have to include anything. Include what you need for the implementation on your cpp file.
Use smart pointers instead of raw pointers.
I may be missing something, but you don't appear to be using shutdown(). Remove this function, move the call to glfwTerminate to the end of main().
Terminate the application by changing 'while(1)' in the main loop to 'while(running)' where running is a bool. When the user presses escape, set running to false. Try to avoid using exit(), it makes it harder to reason about code.
Add parameter names to your function declarations. They're a form of documentation. When peeking at the header, I have no idea what I should pass to moveCamera(float, float).
Never put 'using namespace x' in a header, this kills the benefits of namespaces in every file that includes it, directly or indirectly.
Don't handle keypresses in your camera class. Add functions to the class which allow you to move the camera, call these from another place where you handle all user input.
There is more I can find, but this should be enough for now. Please let me know if you have any more questions.
#4921317 Bloom Fail
Posted by Rene Z
on 12 March 2012 - 07:03 AM
#4911628 glsl problem
Posted by Rene Z
on 10 February 2012 - 05:53 AM
#4907330 Dynamic texture allocation problem
Posted by Rene Z
on 29 January 2012 - 09:04 AM
#4894163 Speed up x parser
Posted by Rene Z
on 15 December 2011 - 06:55 AM
If you really want to know where most of the time is spent, make a test program which only loads an x file and profile it. AMD CodeAnalyst is a decent free profiler:
http://developer.amd...es/default.aspx
#4869400 Gradient Weighted random number
Posted by Rene Z
on 05 October 2011 - 07:33 AM
In pseudocode:
uniformRand = rand(); outputPoint = A + uniformRand*uniformRand * (B-A);
#4841593 Closest point on ray to AABB?
Posted by Rene Z
on 28 July 2011 - 08:19 AM
I'm sorting all my transparent objects by distance from the camera so they can be drawn correctly.
Try to use the distance to the near plane, not to the camera position. Often the distance to the object center is good enough, but if it isn't you can use it's bounding volume.
#4812383 Perfect Collision between Point and Rectangle
Posted by Rene Z
on 18 May 2011 - 03:12 AM
#4777696 GL_BLEND for Multipass Lighting with GLSL
Posted by Rene Z
on 22 February 2011 - 03:17 PM
- Home
- Viewing Profile: Reputation: Rene Z