Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

MindOfCorruption97

Member Since 28 Oct 2012
Offline Last Active Yesterday, 01:55 PM
-----

Posts I've Made

In Topic: OpenGL application stopped working

31 December 2012 - 05:22 PM

Well I made Tex and Bitmap no longer a global variable.

I also checked the debugger and it says the problem is this section of the code.

 if((i + 1) % padWidth == 0)
{
i += offset;
}
*(pixelData + j + 2) = *(tempPixelData + i);
*(pixelData + j + 1) = *(tempPixelData + i + 1);
*(pixelData + j) = *(tempPixelData + i + 2);
j++;

I tried deleting that part of the code and it worked but it didn't show the texture.

Any idea what could be wrong?


In Topic: OpenGL Triangle not being displayed

26 December 2012 - 04:19 PM

You're passing hDc and hRc to EnableOpenGL by value but expect the function to change the values in your main function since you're using those variables later. Pass them by reference instead if you expect the function to change the original variables and not the parameter variables local to the function itself. You're also not creating the device context anywhere; you need to call GetDC to actually get the value for hDc.

 

You're missing many of these errors because you're not checking the return values from the functions. You definitely should start checking for errors from the functions you call; they are there for a reason.

Thank you for that. You saved me from future errors with my program.

But after looking at the code bit.

I switched

GetMessage(&msg,NULL,0,0) > 0

with

 

PeekMessage(&msg,NULL,0,0,PM_REMOVE)

 

making the program work. Thank you for giving me more insight on opengl.

:D


In Topic: C++ Opengl, unresolved externals after linking libraries

06 November 2012 - 07:40 PM

At the top, you declare EnableOpenGL, but your implementation of it near the bottom of the code is called EnableOpenGl (note the lowercase l).

void EnableOpenGL(HWND hwnd,HDC * hdc,HGLRC * hrc); <-- BIG L end of file void EnableOpenGl(HWND hwnd,HDC * hdc,HGLRC * hrc) <-- little l


Thank you, I never knew that the problem was so simple.
Now it works great. Posted Image

PARTNERS