Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

/Users/blackie/Documents/myRepository/phobosengine-vc2005/phobosengine/phobosengine/SDLApplication.cpp File Reference

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

Include dependency graph for SDLApplication.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  pge

Typedefs

typedef int(* PFNWGLEXTGETSWAPINTERVALPROC )(void)

Functions

typedef void (APIENTRY *PFNWGLEXTSWAPCONTROLPROC)(int)
bool initVSync ()
bool vsyncEnabled ()
void setVSyncEnabled (bool enable)

Variables

PFNWGLEXTSWAPCONTROLPROC wglSwapIntervalEXT = NULL
PFNWGLEXTGETSWAPINTERVALPROC wglGetSwapIntervalEXT = NULL


Typedef Documentation

typedef int(* PFNWGLEXTGETSWAPINTERVALPROC)(void)
 

Definition at line 8 of file SDLApplication.cpp.

Referenced by initVSync().


Function Documentation

bool initVSync  ) 
 

Definition at line 13 of file SDLApplication.cpp.

References PFNWGLEXTGETSWAPINTERVALPROC, wglGetSwapIntervalEXT, and wglSwapIntervalEXT.

Referenced by pge::SDLApplication::openWindow().

00013                  {
00014         char* extensions = (char*)glGetString(GL_EXTENSIONS);
00015 
00016         if (strstr(extensions,"WGL_EXT_swap_control")) {
00017                 wglSwapIntervalEXT = (PFNWGLEXTSWAPCONTROLPROC)wglGetProcAddress("wglSwapIntervalEXT");
00018                 wglGetSwapIntervalEXT = (PFNWGLEXTGETSWAPINTERVALPROC)wglGetProcAddress("wglGetSwapIntervalEXT");
00019                 return true;
00020         } else {
00021                 return false;
00022         }
00023 }

void setVSyncEnabled bool  enable  ) 
 

Definition at line 29 of file SDLApplication.cpp.

References wglSwapIntervalEXT.

Referenced by pge::SDLApplication::openWindow().

00029                                   {
00030         if (enable) {
00031                 wglSwapIntervalEXT(1);
00032         } else {
00033                 wglSwapIntervalEXT(0);
00034         }
00035 }

typedef void APIENTRY *  PFNWGLEXTSWAPCONTROLPROC  ) 
 

bool vsyncEnabled  ) 
 

Definition at line 25 of file SDLApplication.cpp.

References wglGetSwapIntervalEXT.

00025                     {
00026         return (wglGetSwapIntervalEXT() > 0);
00027 }


Variable Documentation

PFNWGLEXTGETSWAPINTERVALPROC wglGetSwapIntervalEXT = NULL
 

Definition at line 11 of file SDLApplication.cpp.

Referenced by initVSync(), and vsyncEnabled().

PFNWGLEXTSWAPCONTROLPROC wglSwapIntervalEXT = NULL
 

Definition at line 10 of file SDLApplication.cpp.

Referenced by initVSync(), and setVSyncEnabled().


Generated on Mon Oct 16 12:08:35 2006 for Phobosengine by doxygen 1.3.4