GLFW

Started by
1 comment, last by Monkan 12 years, 11 months ago
Hi,

I've always used glut for all my windowing and input things with OpenGL but I decided I want to try using GLFW instead because it seems a lot newer, cleaner and in general better.

I'm finding it really hard just getting it to work. I downloaded the zip file from the website and was hoping that the files would just be in there like when I downloaded glut but instead it says I have to compile it myself.
I'm a bit of a noob at these things so I don't really know how to use makefiles. They are something I have looked into a couple of times and no one seems to explain the tools I need and what I do to get what I need out of them in a way that I understand.

So I found this topic http://www.gamedev.net/topic/316102-glfw-linking-problems/
which explains how to compile with Visual Studio. I did everything it says and built it. It compiles but it might not be compiling correctly.because when I put the .lib, .h and dll files in my program and call glfwInit() it doesn't return true.
I had a look at the output when I compile glfw and there are loads of errors along the lines of -
warning C4133: 'function' : incompatible types - from 'char [7]' to 'LPCWSTR'
On the internet there are similar errors in places and it says put and L in front of the char[] but now I'm changing the glfw files which I'm sure I'm not suppose to do.

Any advice on what my problem might be or if I'm not doing something right would be very appreciated.
This is my program that uses glfw where the glfwInit() always returns false if there is an error there. It compiles fine with no errors.



#define GLFW_DLL
#include "GL\glfw.h"
#include <iostream>

int main(int argc, char *argv[])
{
if(glfwInit() != GL_TRUE)
{
std::cout << "GLFW Failed......";
return 0;
}

glfwOpenWindow(800, 600, // Window size
8, 8, 8, 8, // bitdepth per channel (RGBA)
24, // Z buffer bitdepth
0, // Aux buffer bitdepth
GLFW_WINDOW // Window
);

while(true)
{

}
glfwTerminate();
return 0;
}



It always exits when glfwInit is called.

Please help.
Thanks.

"To know the road ahead, ask those coming back."

Advertisement
On the GLFW download page theres a section called
Binary archive for Windows
[font=sans-serif][size=2]which has a download for precompiled libraries for visual studio 9&10[/font][font=sans-serif][size=2]
[/font]
[font="sans-serif"]http://prdownloads.sourceforge.net/glfw/glfw-2.7.bin.WIN32.zip[/font]
Ha ha, O dear.


I cant believe I didn't see that. O well you live and learn eh, me just being slow. I'll try to be more observant next time instead of over complicating things.

Thank you so much.

smile.gif

"To know the road ahead, ask those coming back."

This topic is closed to new replies.

Advertisement