• Create Account

## First example in OpenGL

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

5 replies to this topic

### #18Observer8  Members

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 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?

Sorry if I make mistakes. My English is not good for a while yet.

### #2BitMaster  Members

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.

### #38Observer8  Members

Posted 07 August 2014 - 03:56 AM

I will use Qt instead GLFW

Sorry if I make mistakes. My English is not good for a while yet.

### #48Observer8  Members

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.

Sorry if I make mistakes. My English is not good for a while yet.

### #5aregee  Members

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);

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.

### #6temakonkin_n  Members

Posted 11 August 2014 - 07:26 AM

Hi,

Sorry for my English in advance

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

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

Sorry for the error, use an interpreter.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.