Jump to content
  • Advertisement
Sign in to follow this  
max95

Problem with glGenBuffersARB

This topic is 2694 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i use VS 2010 and when i execute the program, console window stops working. so i executed in debug mode and the break is hit at this line

glGenBuffersARB(1, &pbo);

here is the code snippet


GLuint pbo;
glGenBuffersARB(1, &pbo);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, width*height*sizeof(GLubyte)*4, myimage, GL_STREAM_DRAW_ARB);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);



i have put glew version 1.5, copied the dll, header, lib files in the right places. i have no compilation errors at all.

i just dont understand whats wrong. PLEASE HELP...

Share this post


Link to post
Share on other sites
Advertisement
And what is the error that you hit when it breaks?

Did you make sure to glewInit before you call this, and do you make sure that glewInit return value is good?

Share this post


Link to post
Share on other sites

And what is the error that you hit when it breaks?

Did you make sure to glewInit before you call this, and do you make sure that glewInit return value is good?


i didnt know about glewinit, i googled it and added this code to my code



GLenum err = glewInit();
if (GLEW_OK != err)
{
fprintf(stderr, "your error is : %s\n", glewGetErrorString(err));
}
fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));



and in the output i am getting

your error is: missing GL version
status: using GLEW 1.5.7[/quote]



and in the watch tab the error given is

glGenBuffersARB CXX0017: Error: symbol "glGenBuffersARB" not found


so what should i do now??

Share this post


Link to post
Share on other sites
You need to setup your opengl context before calling glewInit, which I guess is why you have the missing GL version error.

Share this post


Link to post
Share on other sites

You need to setup your opengl context before calling glewInit, which I guess is why you have the missing GL version error.


could u please give me a reference to create openGL context. i dont know how to do that.

Share this post


Link to post
Share on other sites

You need to setup your opengl context before calling glewInit, which I guess is why you have the missing GL version error.


ok i am assuming that i have to create a window make some initial settings. before calling glewInit

i dont want to do that. my purpose of this program is to copy the image into the buffer so that the GPU executes it. i have already input an bitmap image and converted into array. copying this array to GPU takes 20 seconds. if i copy the image using buffer then it will copy within a second.




struct cudaGraphicsResource *cuda_pbo_resource;
GLuint pbo;

glGenBuffersARB(1, &pbo);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, width*height*sizeof(GLubyte)*4, h_img, GL_STREAM_DRAW_ARB);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
cudaGraphicsGLRegisterBuffer(&cuda_pbo_resource, pbo, cudaGraphicsMapFlagsWriteDiscard);

cudaGraphicsMapResources(1, &cuda_pbo_resource, 0);
size_t num_bytes;
cudaGraphicsResourceGetMappedPointer((void **)&d_result, &num_bytes, cuda_pbo_resource);




this is the code. is there anyway to make this work without creating an openGL window.

Share this post


Link to post
Share on other sites
I don't think so. I haven't seen any method or extension except that MESA had some offline renderer/context thing (www.mesa3d.org)

or just create your window and make it invisible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!