Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 30 Aug 2010
Offline Last Active Aug 12 2015 12:28 PM

Posts I've Made

In Topic: Can't run GL_NV_path_rendering extension demos

01 August 2015 - 06:52 PM

Strange. Perhaps the demos are run on Intel graphics by default, if you have auto-switching graphics on your laptop. Try setting the default to the NVidia.


Or print all available extensions to see if everything looks right.

#include <fstream>
#include <string>
#include <algorithm>
#include <gl/gl.h>


wglMakeCurrent(hDC, hGLRC);
	std::ofstream file("extensions.txt", std::ios::trunc);
	file << glGetString(GL_VENDOR) << '\n' << glGetString(GL_VERSION) << "\n\n";
	std::string str(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
	std::replace(str.begin(), str.end(), ' ', '\n');
	file << str;

And if it's still missing make sure you have the latest drivers (nvidia.com).


Oh shit, this is exactly what is happening. Didn't think to check it, just assumed it was running on my 980M. Now just need to figure out how to make GLFW force use the 980M.


Edit: This was caused my Nvidia's Optimus software for laptops. The solution is super simple, just export a flag on windows. Just add this to your main file with window.h and it will work great.


extern "C" 
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;

In Topic: Tips for Programming a GUI

28 April 2014 - 09:29 PM

One note unless GUIWindow is this I recommend a UIPanel class. This is pretty much just a group of components that has a size and can organize children relative to its position. It lets you anchor points and you will need a margin / anchor property to make sure everything lines up unless you are only wanting to support 1 resolution. Another convenient figure is if you allow it to clip children. Then you can create scroll views. Most gui utilities support panels, grids, and other organizational items but you can get by with just a panel to be honest. Also by supporting children to organizational objects you can build together different parts to make more complicated components.  Also when you create your event system you can search through your items in a tree structure rather then a linear list. Also you NEED events / callbacks. If you are in c++ use FastDelegate as a base for your delegate system and build an event class. Most other languages have some sort of support for that otherwise.


Common components I use.

1. Textbox

2. Texture Button

3. Label

4. Progress Bar / Slider (these components internally will be very similar)

5. Scrollview

In Topic: Depth Buffer Issue

21 April 2012 - 06:07 PM

Found out the issue. I changed this


: /

In Topic: How can i translate mesh with vector?

21 April 2012 - 05:58 PM

I have already traslate a mesh with the function D3DXMatrixTranslation in a precise position of the 3D space. But how can i do to move the mesh in direction with a vector?
Sorry for my english Posted Image .

Easiest way is to keep a hold of the position you want is in a vector than when it comes time to actually do the transformation transform it into a matrix.

so in your game logic you can simply do position += velocity or something like that, but when your it comes time to render just do
D3DXMatrixTranslation and multiply the mesh by the matrix.

In Topic: Design: Object transformation

18 April 2012 - 03:16 PM

I don't understand what you use those "vectors" for or why they have a last coordinate 1 instead of 0... I am trying to fit what you are saying into the relevant math I know, and it's not working.

Model is centered at <0,0,0,1> 4-D vector or the origin.

So x-axis is <1,0,0,1> and z-axis is <0,0,1,1,>. We arbitrarily define a given vector as "forward" or "backward" or "up" based on which way we preferred. The result is that if you want the "forward" of a model you can just take the "forward" vector and multiply it by the world matrix of a model and get the direction it's facing.

Really 99% of the time we wanted rotation information from the model it was which way is "forward" or "up" or "down" or "left" so we would take the vector denoting the default forward and multiply it by the models world matrix to get which way it was facing. So before model->world transformation we know that forward is the same as the "forward" vector constant. So which way it is facing now is "forward" * WorldMatrix.

Object transformations were simply handled by augmenting this matrix. So you want to rotate it along the Zaxis? Call matrix.RotateZ(float angle) and rotate the object. Want to Translate it? Call matrix.Translate(x,y,z). Was pretty easy overall.

This one matrix inherently had all the information we needed readily available so we just used that.

[ stuff stuff stuff 0]
[stuff stuff stuff 0]
[stuff stuff stuff 0]
[x-pos, y-pos, z-pos 1]

The only objects we needed that needed to know exact angles was the camera which was handled with a Quaternion.

i really only use quaternion's interpolating rotation based animations, for character movement and whatnot matrices are easier imo. . Want the object to slowly move some direction? Get the vector pointing to the object and slerp all day.