Jump to content

  • Log In with Google      Sign In   
  • Create Account


First example in OpenGL

  • You cannot reply to this topic
5 replies to this topic

#1 8Observer8   Members   -  Reputation: 106

Like
0Likes
Like

Posted 07 August 2014 - 01:11 AM

Hi,

 

Sorry for my English in advance :)

 

I am new in OpenGL. I started from the book SuperBible, 6th

 

I downloaded the examples from the website: http://www.openglsuperbible.com/

I opened "solution" of the examples in Visual 2010 Express Edition. I ran "alienrain" example but it failed here:

 

            if (!glfwOpenWindow(info.windowWidth, info.windowHeight, 8, 8, 8, 0, 32, 0, GLFW_WINDOW))
            {
                fprintf(stderr, "Failed to open window\n");
                return;
            }

 

Why is "glfwOpenWindow" failed?


www.gokgs.com


Sponsor:

#2 BitMaster   Crossbones+   -  Reputation: 3903

Like
0Likes
Like

Posted 07 August 2014 - 01:24 AM

I have no clue what you mean by "failed". When you have problems you should always copy and paste the exact error message.

If by "failed" you mean "unresolved external" then you will need to link to the GLFW library.

#3 8Observer8   Members   -  Reputation: 106

Like
0Likes
Like

Posted 07 August 2014 - 03:56 AM

I will use Qt instead GLFW :)


www.gokgs.com


#4 8Observer8   Members   -  Reputation: 106

Like
0Likes
Like

Posted 07 August 2014 - 03:58 AM

How to describe on the thread on this forum?


Edited by 8Observer8, 07 August 2014 - 03:58 AM.

www.gokgs.com


#5 aregee   Members   -  Reputation: 1016

Like
1Likes
Like

Posted 07 August 2014 - 11:58 AM

Do you mean that you are getting the following error message:

 

"Failed to open window"?

 

In that case, it means your code is compiling just fine, but you are probably sending some wrong parameters to GLFW somewhere.

 

If you add this in the beginning of your code, before you initialise GLFW or do anything related to GLFW:

    glfwSetErrorCallback(error_callback);

And then add this function to your code:

static void error_callback(int error, const char* description)
{
    fputs(description, stderr);
    printf("\n");
}

You should see the proper error message in the console.

 

If your code doesn't even compile, there can be lots of reasons.  Please provide more specific error message.

 

EDIT:

 

I am a bit weary about you using glfwOpenWindow() function, as I can see it mentioned in old documentation, but not in new documentation.  The newer version is using glfwCreateWindow().   Which version of GLFW are you using?  My compiler can't even find that function.  I suggest you go to the "Getting Started" guide on the GLFW web page: http://www.glfw.org/docs/latest/quick.html and compile a newer version of GLFW.


Edited by aregee, 07 August 2014 - 12:10 PM.


#6 temakonkin_n   Members   -  Reputation: 144

Like
0Likes
Like

Posted 11 August 2014 - 07:26 AM

Hi,

 

Sorry for my English in advance smile.png

 

I am new in OpenGL. I started from the book SuperBible, 6th

 

I downloaded the examples from the website: http://www.openglsuperbible.com/

I opened "solution" of the examples in Visual 2010 Express Edition. I ran "alienrain" example but it failed here:

            if (!glfwOpenWindow(info.windowWidth, info.windowHeight, 8, 8, 8, 0, 32, 0, GLFW_WINDOW))
            {
                fprintf(stderr, "Failed to open window\n");
                return;
            }

Why is "glfwOpenWindow" failed?

 

Use the SDl for create window, and you will be happy!

 

https://wiki.libsdl.org/SDL_CreateWindow







PARTNERS