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

#5244073 Can't run GL_NV_path_rendering extension demos

Posted by on 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;

#5150239 Tips for Programming a GUI

Posted by on 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

#4791077 Issue with creating a geometry shader for creating textured quads

Posted by on 27 March 2011 - 02:55 PM

You don't actually describe what the problem is. Is it not drawing anything? is the texture not showing? is the texture wrong?

Anyway, various things to think about:
As with someone else recently, you have "varying in" and "varying out". Both varying and in / out are storage qualifiers - I'm pretty sure it's not meant to be valid to use both of them. I'd suggest using in / out since varying is deprecated (and I'm not actually sure you can use varying in anything other than vertex / fragment shaders).

I assume "Texture" is a variable containing the location of the sampler retrieved via glGetUniformLocation, and that your BindTexture member correctly calls glActiveTexture and glBindTexture?

Note that you don't have to bind the array buffer as well as the vertex array in the draw call.

You don't appear to be calling glEnableVertexAttribArray anywhere.

Alright I looked into glEnableVertexAttribArray so that's fixed. However I still didn't get anything to show, so i messed with the shader. It seems that for some reason my final value of vec4 vPosition is getting overwritten somehow. If i manually set the height I get a perfect textured quad, but if i try to read it from the incoming vertex I can't see anything.

lol ok, found out the issue. I simply wasn't referencing my position through gl_in[] instead I was trying to reference through another variable. : P it's working perfectly now.