#include "stdafx.h"
#include <windows.h>

//#include "wglext.h"
void setVSync(bool sync)
{
typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALPROC)( int );
PFNWGLSWAPINTERVALPROC wglSwapIntervalEXT = 0;
const char *extensions = (char*)glGetString(GL_EXTENSIONS);

if( strstr( extensions, "WGL_EXT_swap_control" ) == 0 )
{
return;
}
else
{
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALPROC)wglGetProcAddress( "wglSwapIntervalEXT" );

if( wglSwapIntervalEXT )
wglSwapIntervalEXT(sync);
}
}


dù em đã đặt glGetString và GL_EXTENSIONS là (char *) nó vẫn báo lỗi

error C2065: 'GL_EXTENSIONS' : undeclared identifier
error C3861: 'glGetString': identifier not found


mấy anh sửa lại dùm em cho đúng. em cảm ơn nhiều ( thư viện wglext.h không tồn tại nên em ko dám cho vào )