Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


MindOfCorruption97

Member Since 28 Oct 2012
Offline Last Active Jun 19 2013 01:57 PM

Topics I've Started

Bullets won't shoot up or down

12 June 2013 - 11:07 AM

Hey, I have a problem.
You see, for some reason, I am not able to shoot up or down. After a few hours looking I couldn't seem to find the error to this issue. So can anyone help me point out what is causing the bullets not go up nor down.

 

Player.h

#ifndef PLAYER_H
#define	PLAYER_H

#include <GL/glfw.h>
#include <vector>

#include "tools.h"

using namespace std;

class Bullet;

class Player{
public:
    void init();
    void draw();
    void update();
    
    void keyListener();
    void mouseMotionListener();
    void mouseClickListener();
    
    void setVx(int Vx){intVx = Vx;}
    void setVy(int Vy){intVy = Vy;}
    void velocity();
    void shoot(int intDir);
    
    void nothing(){}
    
    Rectangle getPlayer(){return rectPlayer;}
    Point getMotion(){return ptMotion;}
    Point getClick(){return ptClick;}
private:
    int intX,intY,intVx,intVy,intWidth,intHeight;
    bool blInitiated;
    
    vector<Bullet> vectBullet;
    
    Rectangle rectPlayer;
    Point ptMotion,ptClick;
};

class Bullet{
public:
    Bullet(int X,int Y);
    ~Bullet();
    
    void draw();
    void update();
    
    void setVx(int Vx){intVx = Vx;}
    void setVy(int Vy){intVy = Vy;}
    void velocity();
    
    Rectangle getBullet(){return rectBullet;}
private:
    int intX,intY,intVx,intVy;
    
    Rectangle rectBullet;
};

#endif

Player.cpp

#include "Player.h"

void Player::init(){
    blInitiated = false;
    
    intX = 0;
    intY = 0;
    intWidth = 50;
    intHeight = 50;
    
    rectPlayer = createRectangle(intX,intY,intWidth,intHeight);
    
    blInitiated = true;
}
void Player::draw(){
    glColor3f(0.0,0.0,255.0);
    drawRectangle(rectPlayer.intX,rectPlayer.intY,rectPlayer.intWidth,rectPlayer.intHeight);
    
    for(int i = 0;i < vectBullet.size();i++){
        vectBullet.at(i).draw();
    }
}
void Player::update(){
    if(!blInitiated){init();}else{nothing();}
    
    rectPlayer.intX = intX;
    rectPlayer.intY = intY;
    rectPlayer.intWidth = intWidth;
    rectPlayer.intHeight = intHeight;
    
    velocity();
    
    for(int i = 0;i < vectBullet.size();i++){
        vectBullet.at(i).update();
    }
}

void Player::velocity(){
    intX += intVx;
    intY += intVy;
}
void Player::shoot(int intDir){
    vectBullet.push_back(Bullet(intX + 23,intY + 23));
    if(intDir == 1){vectBullet.back().setVy(-10);}
    else if(intDir == 2){vectBullet.back().setVy(-10);}
    if(intDir == 3){vectBullet.back().setVx(-10);}
    else if(intDir == 4){vectBullet.back().setVx(+10);}
}

void Player::keyListener(){
    if(glfwGetKey('A') == GLFW_PRESS){setVx(-3);}
    else if(glfwGetKey('D') == GLFW_PRESS){setVx(+3);}
    else{setVx(0);}
    if(glfwGetKey('W') == GLFW_PRESS){setVy(-3);}
    else if(glfwGetKey('S') == GLFW_PRESS){setVy(+3);}
    else{setVy(0);}
    
    if(glfwGetKey(GLFW_KEY_UP) == GLFW_PRESS){shoot(1);}
    else if(glfwGetKey(GLFW_KEY_DOWN) == GLFW_PRESS){shoot(2);}
    else if(glfwGetKey(GLFW_KEY_LEFT) == GLFW_PRESS){shoot(3);}
    else if(glfwGetKey(GLFW_KEY_RIGHT) == GLFW_PRESS){shoot(4);}
}
void Player::mouseMotionListener(){glfwGetMousePos(&ptMotion.intX,&ptMotion.intY);}
void Player::mouseClickListener(){
    if(glfwGetMouseButton(GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS){
        glfwGetMousePos(&ptClick.intX,&ptClick.intY);
    }
}

//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Bullet::Bullet(int X, int Y){
    intX = X;
    intY = Y;
    rectBullet = createRectangle(intX,intY,4,4);
}
Bullet::~Bullet(){}

void Bullet::draw(){
    glColor3f(0.0,0.0,255.0);
    drawRectangle(rectBullet.intX,rectBullet.intY,rectBullet.intWidth,rectBullet.intHeight);
}
void Bullet::update(){
    
    rectBullet.intX = intX;
    rectBullet.intY = intY;
    
    velocity();
}

void Bullet::velocity(){
    intX += intVx;
    intY += intVy;
}

It's just Vy(velocity of Y) won't set. I tried replacing "setVy" with "setVx" so I know the keyboard isn't the problem. It's something to do with setVy but I don't know what.

PS. I tested it out and I know the problem is somewhere in the "shoot()".


OpenGL application stopped working

31 December 2012 - 03:35 PM

Sorry to ask but for some reason my OpenGL application does not seem to work. When I try to run/debug my application it stops and shows a message that my application stopped working. I tried to find ways to fix it, but I don't know what is causing to to stop working.

 

I listed all the classes and files associated with my application.

 

MainWindow.cpp

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

#include "EditorLink.h"

const char g_szClassName[] = "Window";
BOOL quit = FALSE;

void EnableOpenGL(HWND hWnd,HDC * hDc,HGLRC * hRc);
void DisableOpenGL(HWND hWnd,HDC hDc,HGLRC hRc);

Editor Edit;

LRESULT CALLBACK WndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            quit = TRUE;
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        default:
            return DefWindowProc(hWnd,msg,wParam,lParam);
    }
}

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR CmdLine,int nCmdShow)
{
    WNDCLASS wc;
    HWND hWnd;
    HGLRC hRc;
    HDC hDc;
    MSG msg;
    
    wc.lpszClassName = g_szClassName;
    wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
    wc.hInstance = hInstance;
    wc.style = CS_OWNDC;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.lpfnWndProc = WndProc;
    wc.lpszMenuName = NULL;
    wc.hCursor = LoadCursor(NULL,IDC_ARROW);
    wc.hIcon = LoadIcon(NULL,NULL);
    RegisterClass(&wc);
    
    hWnd = CreateWindow(
            g_szClassName,
            "OPENGL PRACTICE",
            WS_OVERLAPPEDWINDOW | WS_CAPTION | WS_POPUP | WS_VISIBLE,
            CW_USEDEFAULT,CW_USEDEFAULT,800,700,
            NULL,NULL,hInstance,NULL
            );
    
    EnableOpenGL(hWnd,&hDc,&hRc);
    Edit.init(hInstance);
    
    ShowWindow(hWnd,nCmdShow);
    UpdateWindow(hWnd);
    
    while(!quit)
    {
        if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
        else
        {
            Edit.display();
            SwapBuffers(hDc);
        }
    }
    
    DisableOpenGL(hWnd,hDc,hRc);
    DestroyWindow(hWnd);
    
    return msg.wParam;
}


void EnableOpenGL(HWND hWnd,HDC * hDc,HGLRC * hRc)
{
    *hDc = GetDC(hWnd);
    int nFormat;
    
    PIXELFORMATDESCRIPTOR pfd =
    {
        sizeof(PIXELFORMATDESCRIPTOR),
        1,
        PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
        PFD_TYPE_RGBA,
        0,0,0,0,0,0,0,0,0,0,0,0,0,
        24,
        8,
        0,
        PFD_MAIN_PLANE,
        0,0,0,0
    };
    
    nFormat = ChoosePixelFormat(*hDc,&pfd);
    SetPixelFormat(*hDc,nFormat,&pfd);
    
    *hRc = wglCreateContext(*hDc);
    wglMakeCurrent(*hDc,*hRc);
}

void DisableOpenGL(HWND hWnd,HDC hDc,HGLRC hRc)
{
    wglMakeCurrent(NULL,NULL);
    wglDeleteContext(hRc);
    ReleaseDC(hWnd,hDc);
}

Editor.h

#include <windows.h>

#ifndef EDITORLINK_H
#define	EDITORLINK_H

class Editor
{
public:
    void init(HINSTANCE hInstance);
    void display();
private:
};

#endif

 

Editor.cpp

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

#include "EditorLink.h"
#include "Texture.h"

unsigned int tex;
Bitmap *bitmap;

void Editor::init(HINSTANCE hInstance)
{
    glClearColor(0.0,0.0,0.0,1.0);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(45,640.0/480.0,1.0,500.0);
    glMatrixMode(GL_MODELVIEW);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    glEnable(GL_TEXTURE_2D);
    
    float dif[] = {1.0,1.0,1.0,1.0};
    glLightfv(GL_LIGHT0,GL_DIFFUSE,dif);
    float amb[] = {0.2,0.2,0.2,1.0};
    glLightfv(GL_LIGHT0,GL_AMBIENT,amb);
    
    tex = bitmap->loadTexture("Practice.bmp");
}

void Editor::display()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    
    float pos[] = {-2.0,2.0,-3.0,1.0,};
    glLightfv(GL_LIGHT0,GL_POSITION,pos);
    
    glTranslatef(0.0,0.0,-5.0);
    
    glBindTexture(GL_TEXTURE_2D,tex);
    glBegin(GL_QUADS);
    glTexCoord2f(0.0,1.0);
    glVertex3f(-2.0,2.0,0.0);
    glTexCoord2f(0.0,0.0);
    glVertex3f(-2.0,-2.0,0.0);
    glTexCoord2f(1.0,0.0);
    glVertex3f(2.0,-2.0,0.0);
    glTexCoord2f(1.0,1.0);
    glVertex3f(2.0,2.0,0.0);
    glEnd();
}

 

Texture.h

#include <windows.h>
#include <cstdio>

#ifndef TEXTURE_H
#define	TEXTURE_H

class Bitmap
{    
public:
    RGBQUAD getColors(){return *colors;}
    BYTE getPixelData(){return *pixelData;}
    bool getLoaded(){return loaded;}
    LONG getWidth(){return width;}
    LONG getHeight(){return height;}
    WORD getBpp(){return bpp;}
    bool loadBmp(const char * FileName);
    unsigned int loadTexture(const char * FileName);
private:
    RGBQUAD *colors;
    BYTE *pixelData;
    bool loaded;
    LONG width,height;
    WORD bpp;
    BITMAPFILEHEADER bmfh;
    BITMAPINFOHEADER bmih;
};

#endif


Texture.cpp

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

#include "Texture.h"

bool Bitmap::loadBmp(const char* FileName)
{
    int numColors,offset;
    DWORD size,diff;
    BYTE *tempPixelData;
    LONG byteWidth,padWidth;
    
    FILE *in;
    in = fopen(FileName,"rb");
    fread(&bmfh,sizeof(BITMAPFILEHEADER),1,in);
    fread(&bmih,sizeof(BITMAPINFOHEADER),1,in);
    
    numColors = 1 << bmih.biBitCount;
    
    size = bmfh.bfSize - bmfh.bfOffBits;
    tempPixelData = new BYTE[size];
    byteWidth = padWidth = (LONG)((float)width * (float)bpp/8.0);
    
    height = bmih.biHeight;
    diff = height * byteWidth;
    
    if(bmih.biBitCount == 8)
    {
        colors = new RGBQUAD[numColors];
        fread(colors,sizeof(RGBQUAD),numColors,in);
    }
    if(tempPixelData == NULL)
    {
        fclose(in);
        return false;
    }
    fread(tempPixelData,sizeof(BYTE),size,in);
    
    while(padWidth % 4 != 0)
    {
        padWidth++;
    }
    if(height > 0)
    {
        int j = size - 3;
        offset = padWidth - byteWidth;
        for(int i = 0;i < size;i += 3)
        {
            if((i + 1) % padWidth == 0)
            {
                i += offset;
            }
            *(pixelData + j + 2) = *(tempPixelData + i);
            *(pixelData + j + 1) = *(tempPixelData + i + 1);
            *(pixelData + j) = *(tempPixelData + i + 2);
            j++;
        }
    }
    else
    {
        height = height* - 1;
        offset = 0;
        do{
            memcpy((pixelData + (offset * byteWidth)),
                    (tempPixelData + (offset * byteWidth)),
                    byteWidth);
            offset++;
        }while(offset < height);
    }
}

unsigned int Bitmap::loadTexture(const char * FileName)
{
    if(loadBmp(FileName))
    {
        unsigned int id;
        glGenTextures(1,&id);
        glBindTexture(GL_TEXTURE_2D,id);
        glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,width,height,0,GL_RGB,GL_UNSIGNED_BYTE,pixelData);
        
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
        
        return id;
    }
}

 

Thank you, sorry to waste your time.

Also can you guys tell me what causes an application to stop working? Since I want to make sure I could prevent this from happening in the future.


OpenGL Triangle not being displayed

26 December 2012 - 02:43 PM

Hello gents, I require some assistance. For some reason, my win32 program refuses to display a triangle. I've tried to find ways to fix it, but my attempts seem to result in failures.
Here is the code to my program.

 

My window class.

#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

#include "EditorLink.h"

const char g_szClassName[] = "Window";
BOOL quit = FALSE;

void EnableOpenGL(HDC hDc,HGLRC hRc);
void DisableOpenGL(HDC hDc,HGLRC hRc);

Editor Edit;

LRESULT CALLBACK WndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            quit = TRUE;
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        default:
            return DefWindowProc(hWnd,msg,wParam,lParam);
    }
}

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR CmdLine,int nCmdShow)
{
    WNDCLASS wc;
    HWND hWnd;
    HGLRC hRc;
    HDC hDc;
    MSG msg;
    
    wc.lpszClassName = g_szClassName;
    wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
    wc.hInstance = hInstance;
    wc.style = CS_OWNDC;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.lpfnWndProc = WndProc;
    wc.lpszMenuName = NULL;
    wc.hCursor = LoadCursor(NULL,IDC_ARROW);
    wc.hIcon = LoadIcon(NULL,NULL);
    RegisterClass(&wc);
    
    hWnd = CreateWindow(
            g_szClassName,
            "OPENGL PRACTICE",
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT,CW_USEDEFAULT,700,700,
            NULL,NULL,hInstance,NULL
            );
    
    ShowWindow(hWnd,nCmdShow);
    UpdateWindow(hWnd);
    
    EnableOpenGL(hDc,hRc);
    Edit.init();
    
    while(!quit)
    {
        if(GetMessage(&msg,NULL,0,0) > 0)
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
        else
        {
            Edit.display();
            SwapBuffers(hDc);
        }
    }
    
    DisableOpenGL(hDc,hRc);
    DestroyWindow(hWnd);
    
    return msg.wParam;
}


void EnableOpenGL(HDC hDc,HGLRC hRc)
{
    int nFormat;
    
    PIXELFORMATDESCRIPTOR pfd =
    {
        sizeof(PIXELFORMATDESCRIPTOR),
        1,
        PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
        PFD_TYPE_RGBA,
        0,0,0,0,0,0,0,0,0,0,0,0,0,
        24,
        8,
        0,
        PFD_MAIN_PLANE,
        0,0,0,0
    };
    
    nFormat = ChoosePixelFormat(hDc,&pfd);
    SetPixelFormat(hDc,nFormat,&pfd);
    
    hRc = wglCreateContext(hDc);
    wglMakeCurrent(hDc,hRc);
}

void DisableOpenGL(HDC hDc,HGLRC hRc)
{
    wglMakeCurrent(NULL,NULL);
    wglDeleteContext(hRc);
}

 

And my class where I entered the display data.

#include <gl/gl.h>
#include <gl/glu.h>

#include "EditorLink.h"

void Editor::init()
{
    glClearColor(0.0,0.0,0.0,1.0);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(45,640.0/480.0,1.0,500.0);
    glMatrixMode(GL_MODELVIEW);
}

void Editor::display()
{
    glClear(GL_COLOR_BUFFER_BIT);
    
    glBegin(GL_TRIANGLES);
    glVertex3f(0.0,2.0,-5.0);
    glVertex3f(-2.0,-2.0,-5.0);
    glVertex3f(2.0,-2.0,-5.0);
    glEnd();
}

 

I don't know what is wrong. So some help would be nice.

Thank you and have a nice day.


C++ Opengl, unresolved externals after linking libraries

06 November 2012 - 05:51 PM

Hey all, this is my first post so I'll make it quick.
I currently have a problem in C++ where, after I compile, it prints an error in the console saying:

------ Build started: Project: OpenGL_1, Configuration: Debug Win32 ------
1> CreatingAWindow.cpp
1>CreatingAWindow.obj : error LNK2019: unresolved external symbol "void __cdecl EnableOpenGL(struct HWND__ *,struct HDC__ * *,struct HGLRC__ * *)" (?EnableOpenGL@@YAXPAUHWND__@@PAPAUHDC__@@PAPAUHGLRC__@@@Z) referenced in function _WinMain@16
1>C:\Users\MindOfCorruption97\Desktop\MyStuff\Programming\C++\SDL_OpenGL\Sandbox\OpenGL_1\Debug\OpenGL_1.exe : fatal error LNK1120: 1 unresolved externals

I linked the libraries because before the error was much larger.
After I linked the libraries there was only one error message left as you can see above.
Here is the code if you guys need it:

[source lang="cpp"]#include <windows.h>#include <gl/gl.h>//Function that handles messages sent to your window.//hwnd is the handle to the window, uMsg is the message code, wParam and lParam contains more code about the message.LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);void EnableOpenGL(HWND hwnd,HDC * hdc,HGLRC * hrc);void DisableOpenGL(HWND hwnd,HDC hdc,HGLRC hrc);//wWinMain is the Main method in a windows C++ program.//hinstance is called "handle to an instance" or "handle to a module". It is used to identify the EXE.//nCmdLine contains command line arguments. nCmdShow chooses whether it is minimized, maximized, or hidden.int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow){ WNDCLASS wc; HWND hwnd; HDC hdc; HGLRC hrc; MSG msg; BOOL quit = FALSE; float theta = 0.0f; wc.style = CS_OWNDC; wc.lpfnWndProc = WndProc; //Pointer to the Window Procedure(WindowProc). wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance;//hInstance is used to handle the application instance. wc.hIcon = LoadIcon(NULL,IDI_APPLICATION); wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = "GLSample";//lpszClassName is a string that identifies the window class. RegisterClass(&wc);//Uses the OS to register the window. //Creates a new instance of the window.CreateWindowEx(Window style,Type of window,Title bar). //WS_OVERLAPPEDWINDOW give the window a title bar and all that stuff. hwnd = CreateWindow( "GLSample","OPENGL Window Creation", WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE, 0,0,256,256, NULL,NULL,hInstance,NULL); EnableOpenGL(hwnd,&hdc,&hrc); //Used to dispatch messages to the correct windows. while(!quit) { if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { if(msg.message == WM_QUIT) { quit = TRUE; }else { TranslateMessage(&msg);//Used to translate keyboard input. DispatchMessage(&msg);//Returns the message for the next loop. } }else { glClearColor(0.0f,0.0f,0.0f,0.0f); glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glRotatef(theta,0.0f,0.0f,1.0f); glBegin(GL_TRIANGLES); glColor3f(1.0f,0.0f,0.0f); glVertex2f(0.0f,1.0f); glColor3f(0.0f,0.0f,1.0f); glVertex2f(0.87f,-0.5f); glColor3f(0.0f,0.0f,1.0f); glVertex2f(-0.87f,-0.5f); glEnd(); glPopMatrix(); SwapBuffers(hdc); theta += 1.0f; } } DisableOpenGL(hwnd,hdc,hrc); DestroyWindow(hwnd); return msg.wParam;}LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ switch(uMsg) { case WM_CREATE:return 0; case WM_CLOSE:PostQuitMessage(0);return 0; case WM_DESTROY:return 0; case WM_KEYDOWN: switch(wParam) { case VK_ESCAPE: PostQuitMessage(0); return 0; } return 0; default:return DefWindowProc(hwnd,uMsg,wParam,lParam); }}void EnableOpenGl(HWND hwnd,HDC * hdc,HGLRC * hrc){ PIXELFORMATDESCRIPTOR pfd; int format; *hdc = GetDC(hwnd); ZeroMemory(&pfd,sizeof(pfd)); pfd.nSize = sizeof(pfd); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; pfd.iPixelType = PFD_TYPE_RGBA; pfd.cColorBits = 24; pfd.cDepthBits = 16; pfd.iLayerType = PFD_MAIN_PLANE; format = ChoosePixelFormat(*hdc,&pfd); SetPixelFormat(*hdc,format,&pfd); *hrc = wglCreateContext(*hdc); wglMakeCurrent(*hdc,*hrc);}void DisableOpenGL(HWND hwnd,HDC hdc,HGLRC hrc){ wglMakeCurrent(NULL,NULL); wglDeleteContext(hrc); ReleaseDC(hwnd,hdc);}[/source]
Help as soon as possible, thank you.

PARTNERS