Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# deOpenGL Class Reference

`#include <DOpenGL.hpp>`

Inheritance diagram for deOpenGL:

[legend]
Collaboration diagram for deOpenGL:

[legend]
List of all members.

## Public Member Functions
| deOpenGL (long ID)
| ~deOpenGL ()
long | Release ()
| Delete the object.
deBoolean | Init (HWND WindowHandle)
const deDriverCaps * | GetCaps (long Adapter) const
| Fill a deDriverCaps structure with an adapter's device capabilities.
long | GetAdapterCount () const
| Get the number of adapters supported under this driver.
long | GetModeCount (long Adapter) const
| Get the number of modes for a particular adapter.
deBoolean | WindowedAllowed (long Adapter) const
| Test whether windowed mode is allowed on a particular adapter.
deBoolean | SetDisplay (deDisplay *Display)
deBoolean | Reset (deDisplay *Display)
deBoolean | GetCurrentDisplay (long Adapter, deDisplay *Display) const
deBoolean | GetDisplayMode (long Adapter, long Mode, deDisplay *Display) const
deBoolean | ValidFormat (long Adapter, Resource ResourceType, BPP BPPType, ZPP ZPPType, BPP FrontBuffer, long ExtraFlag=0) const
| Test for a valid format for various resource types.
deBoolean | AddVertexBuffer (IdeVertexBuffer *Vertex)
| Add a vertex buffer to the driver.
deBoolean | RemoveVertexBuffer (IdeVertexBuffer *Vertex)
| Remove a vertex buffer from the driver.
deBoolean | UpdateVertexBuffer (IdeVertexBuffer *Vertex)
| Update a vertex buffer so the driver's internal data matches it.
deBoolean | AddShader (IdeShader *Shader)
deBoolean | RemoveShader (IdeShader *Shader)
deBoolean | SetShader (IdeShader *Shader)
deBoolean | BeginFrame ()
| Call before rendering anything.
deBoolean | EndFrame ()
| Finish the render and update the front-buffer.
deBoolean | ClearFrame (deARGB Color, deBoolean ClearTarget, deBoolean ClearZBuffer, deBoolean ClearStencil)
| Clear the frame with a particular color.
deBoolean | Render (IdeVertexBuffer *VBuffer, long IndexOffset, IdeVertexBuffer *IndexOverride=NULL)
| Render the selected Vertex Buffer to the back-buffer.
deBoolean | SetViewport (long X, long Y, long Width, long Height, deFloat MinZ, deFloat MaxZ)
| Set the screen-space viewport.
deBoolean | SetDepthRange (deFloat MinZ, deFloat MaxZ)
deBoolean | SetFOVClipping (deFloat FOV, deFloat Aspect, deFloat ClipNear, deFloat ClipFar)
| Set up a perspective view transformation.
deBoolean | SetOrthoClipping (deFloat Width, deFloat Height, deFloat ClipNear, deFloat ClipFar, deBoolean Invert=deFALSE)
| Set up an orthographic (parallel projection) view transformation.
deBoolean | SetFOVClippingSubRect (deFloat FOVY, deFloat Aspect, deFloat ClipNear, deFloat ClipFar, deRect SubRect)
| Set up a perspective view transformation with a sub-rect specified in the [0,1] range.
deBoolean | SetFOVClippingSubRectFloat (deFloat FOVY, deFloat Aspect, deFloat ClipNear, deFloat ClipFar, deFloatRect SubRect)
deBoolean | SetOrthoClippingSubRect (deFloat Width, deFloat Height, deFloat ClipNear, deFloat ClipFar, deBoolean Invert, deRect SubRect)
| Set up an orthographic (parallel projection) view transformation with a sub-rect specified in the [0,1] range.
deBoolean | SetOrthoClippingSubRectFloat (deFloat Width, deFloat Height, deFloat ClipNear, deFloat ClipFar, deBoolean Invert, deFloatRect SubRect)
deBoolean | SetCameraTransform (deTransformInfo *M)
| Set the camera transform (position and orientation).
deBoolean | SetCameraTransform (deVertex *Eye, deVertex *At, deVertex *Up)
deBoolean | SetCameraTranslation (deVertex *Translation)
deBoolean | SetCameraRotation (deVertex *Rotation)
deBoolean | ResetCameraIdentity ()
deBoolean | SetWorldTransform (deTransformInfo *M)
| Set the world transform (to take things from "object space" to "world space").
deBoolean | SetWorldTransform (deVertex *Eye, deVertex *At, deVertex *Up)
deBoolean | SetWorldTranslation (deVertex *Translation)
deBoolean | SetWorldRotation (deVertex *Rotation)
deBoolean | ResetWorldIdentity ()
deBoolean | SetTextureTransform (long StageNum, deTransformInfo *Mat)
| Set the texture transform for a particular stage.
deBoolean | AddBitmap (IdeBitmap *Bitmap)
| Adds a bitmap to the driver, turning it into a driver texture, and possibly a render-target.
deBoolean | AddBitmapProxy (IdeBitmapProxy *BitmapProxy)
| Adds a bitmap to the driver, turning it into a driver texture, and possibly a render-target.
deBoolean | RemoveBitmap (IdeBitmap *Bitmap)
| Removes a bitmap from a driver by deleting the internal driver texture.
deBoolean | RenderTo (IdeBitmap *pBitmap, long CubeMapFace=0)
deBoolean | ScreenShot (IdeBitmap *&pBitmap, deBoolean GrabWindow=deTRUE)
deBoolean | GetVideoTexture (IdeBitmap *pBitmap, long CubeMapFace=0)
unsigned long | GetRenderState (RenderState State)
| Get current value of the State passed in.
deBoolean | SetRenderState (const IdeRenderState *State)
| Set a class-based render-state (texture, material, or light).
deBoolean | SetRenderState (RenderState State, unsigned long Value)
| Set a value-based render-state.
deBoolean | EnableLight (long LightID, deBoolean Enable)
deBoolean | DisableAllLights ()
| Disable all fixed-function lights.
deDriverInfo * | deOpenGL::GetInfo () const
IdeDriver::Types | GetType () const
| Get the type of driver this is.
void | InvalidateRenderStates (deBoolean Valid)
## Private Types
typedef deOpenGL::VertexBufferEntry | VertexBufferEntry
typedef deOpenGL::TextureEntry | TextureEntry
## Private Member Functions
void | Present ()
void | Shutdown ()
deBoolean | EnumerateDisplayModes ()
deBoolean | SetTextureState (IdeRenderTexture *State)
deBoolean | SetLightState (IdeRenderLight *State)
deBoolean | SetMaterialState (IdeRenderMaterial *State)
deBoolean | FillBufferInfo (VertexBufferEntry *BufferEntry, IdeVertexBuffer *Vertex, IdeVertexBuffer::BufferType BufferType, deBoolean WipeBuffer)
deBoolean | ProcessVertexBuffer (IdeVertexBuffer *Vertex, VertexBufferEntry *VertexBufferInfo, long BufferFlags)
void | SetVertexBuffer (VertexBufferEntry *VertexBufferInfo)
deBoolean | ToGLBPP (IdeDriver::BPP BPPType, GLint *InternalFormat, GLenum *Format, GLenum *Type) const
unsigned char | GetBPP (IdeDriver::BPP BPPType)
IdeDriver::BPP | GetDestinyBPP (long BPP) const
GLenum | GetOGLTextureWrappingMode (IdeRenderTexture::TextureAddress Address)
## Private Attributes
HGLRC | RC
HDC | DC
deTHashInt< IdeVertexBuffer * > | m_VBufferList
deTHashInt< IdeBitmap * > | m_TexturesList
deDisplay ** | m_Modes
deBoolean | RenderStatesValid
GLenum | AlphaFunction
GLclampf | AlphaRef
GLenum | SrcBlendFactor
GLenum | DestBlendFactor
GLenum | MirroredTextureWrapFlag
deBoolean | NVVertexProgramExt
int | m_AdapterCount
deBoolean * | m_WindowPossible
int * | m_ModeCount
deDriverCaps * | m_Caps

## Member Typedef Documentation

typedef struct deOpenGL::TextureEntry deOpenGL::TextureEntry`[private]`

typedef struct deOpenGL::VertexBufferEntry deOpenGL::VertexBufferEntry`[private]`

## Constructor & Destructor Documentation

deOpenGL::deOpenGL | ( | long | ID | ) |

deOpenGL::~deOpenGL | ( |  | ) |

## Member Function Documentation

deBoolean deOpenGL::AddBitmap | ( | IdeBitmap * | Bitmap | ) | `[virtual]`

| Adds a bitmap to the driver, turning it into a driver texture, and possibly a render-target. Implements deDriver.

deBoolean deOpenGL::AddBitmapProxy | ( | IdeBitmapProxy * | BitmapProxy | ) | `[virtual]`

| Adds a bitmap to the driver, turning it into a driver texture, and possibly a render-target. Implements deDriver.

deBoolean deOpenGL::AddShader | ( | IdeShader * | Shader | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::AddVertexBuffer | ( | IdeVertexBuffer * | Vertex | ) | `[virtual]`

| Add a vertex buffer to the driver. Implements deDriver.

deBoolean deOpenGL::BeginFrame | ( |  | ) | `[virtual]`

| Call before rendering anything. Implements deDriver.

deBoolean deOpenGL::ClearFrame | ( | deARGB | Color,
|  | deBoolean | ClearTarget,
|  | deBoolean | ClearZBuffer,
|  | deBoolean | ClearStencil
| ) | `[virtual]`

| Clear the frame with a particular color. Implements deDriver.

deDriverInfo* deOpenGL::deOpenGL::GetInfo | ( |  | ) | const

deBoolean deOpenGL::DisableAllLights | ( |  | ) | `[virtual]`

| Disable all fixed-function lights. Implements deDriver.

deBoolean deOpenGL::EnableLight | ( | long | LightID,
|  | deBoolean | Enable
| ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::EndFrame | ( |  | ) | `[virtual]`

| Finish the render and update the front-buffer. Implements deDriver.

deBoolean deOpenGL::EnumerateDisplayModes | ( |  | ) | `[private]`

deBoolean deOpenGL::FillBufferInfo | ( | VertexBufferEntry * | BufferEntry,
|  | IdeVertexBuffer * | Vertex,
|  | IdeVertexBuffer::BufferType | BufferType,
|  | deBoolean | WipeBuffer
| ) | `[private]`

long deOpenGL::GetAdapterCount | ( |  | ) | const`[virtual]`

| Get the number of adapters supported under this driver. Implements deDriver.

unsigned char deOpenGL::GetBPP | ( | IdeDriver::BPP | BPPType | ) | `[private]`

const IdeDriver::deDriverCaps * deOpenGL::GetCaps | ( | long | Adapter | ) | const`[virtual]`

| Fill a deDriverCaps structure with an adapter's device capabilities. Implements deDriver.

deBoolean deOpenGL::GetCurrentDisplay | ( | long | Adapter,
|  | deDisplay * | Display
| ) | const`[virtual]`

| Fill a deDisplay with an adapter's CURRENT (even un-renderable) display settings. If a fullscreen rendering mode has not been set up, this will be the desktop settings. Implements deDriver.

IdeDriver::BPP deOpenGL::GetDestinyBPP | ( | long | BPP | ) | const`[private]`

deBoolean deOpenGL::GetDisplayMode | ( | long | Adapter,
|  | long | Mode,
|  | deDisplay * | Display
| ) | const`[virtual]`

  | Feed in a display struct to be filled in for the enumerated mode Parameters:
  Display | [in, out] pointer to a user-created deDisplay struct to be filled in, may not be NULL
Implements deDriver.

long deOpenGL::GetModeCount | ( | long | Adapter | ) | const`[virtual]`

| Get the number of modes for a particular adapter. Implements deDriver.

GLenum deOpenGL::GetOGLTextureWrappingMode | ( | IdeRenderTexture::TextureAddress | Address | ) | `[private]`

unsigned long deOpenGL::GetRenderState | ( | RenderState | State | ) | `[virtual]`

| Get current value of the State passed in. Implements deDriver.

IdeDriver::Types deOpenGL::GetType | ( |  | ) | const`[virtual]`

| Get the type of driver this is. Implements deDriver.

deBoolean deOpenGL::GetVideoTexture | ( | IdeBitmap * | pBitmap,
|  | long | CubeMapFace = 0
| ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::Init | ( | HWND | WindowHandle | ) | `[virtual]`

| Implements deDriver.

void deOpenGL::InvalidateRenderStates | ( | deBoolean | Valid | ) | `[virtual]`

| Implements deDriver.

void deOpenGL::Present | ( |  | ) | `[private]`

deBoolean deOpenGL::ProcessVertexBuffer | ( | IdeVertexBuffer * | Vertex,
|  | VertexBufferEntry * | VertexBufferInfo,
|  | long | BufferFlags
| ) | `[private]`

long deOpenGL::Release | ( |  | ) | `[virtual]`

| Delete the object. Implements IdeDriver.

deBoolean deOpenGL::RemoveBitmap | ( | IdeBitmap * | Bitmap | ) | `[virtual]`

| Removes a bitmap from a driver by deleting the internal driver texture. Implements deDriver.

deBoolean deOpenGL::RemoveShader | ( | IdeShader * | Shader | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::RemoveVertexBuffer | ( | IdeVertexBuffer * | Vertex | ) | `[virtual]`

| Remove a vertex buffer from the driver. Implements deDriver.

deBoolean deOpenGL::Render | ( | IdeVertexBuffer * | VBuffer,
|  | long | IndexOffset,
|  | IdeVertexBuffer * | IndexOverride = NULL
| ) | `[virtual]`

| Render the selected Vertex Buffer to the back-buffer. Implements deDriver.

deBoolean deOpenGL::RenderTo | ( | IdeBitmap * | pBitmap,
|  | long | CubeMapFace = 0
| ) | `[virtual]`

  | Sets the current render-target to the bitmap passed in, if the bitmap can be a render-target. Parameters:
  pBitmap | [in] Bitmap that is a render-target to be rendered to. This bitmap will only act as a handle to the internal driver texture being used, it doesn't contain a copy of what the video card's texture stores
Implements deDriver.

deBoolean deOpenGL::Reset | ( | deDisplay * | Display | ) | `[virtual]`

  | Reset the driver, possibly with altered display properties. Resetting will cause all vertex buffers and textures to be flushed Parameters:
  Display | [in] user-defined display settings, may be NULL to keep current settings
Implements deDriver.

deBoolean deOpenGL::ResetCameraIdentity | ( |  | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::ResetWorldIdentity | ( |  | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::ScreenShot | ( | IdeBitmap *& | pBitmap,
|  | deBoolean | GrabWindow = deTRUE
| ) | `[virtual]`

  | Copies the frontbuffer into the bitmap specified cannot be a render-target Parameters:
  pBitmap | [out] Bitmap pointer that is to have the screen data copied into. A new deBitmap object will be created internally, and its address stored into this parameter. After the data is copied, you must save the file to disk manually, if desired.
Implements deDriver.

deBoolean deOpenGL::SetCameraRotation | ( | deVertex * | Rotation | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetCameraTransform | ( | deVertex * | Eye,
|  | deVertex * | At,
|  | deVertex * | Up
| ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetCameraTransform | ( | deTransformInfo * | M | ) | `[virtual]`

| Set the camera transform (position and orientation). Implements deDriver.

deBoolean deOpenGL::SetCameraTranslation | ( | deVertex * | Translation | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetDepthRange | ( | deFloat | MinZ,
|  | deFloat | MaxZ
| ) | `[virtual]`

| Implements IdeDriver.

deBoolean deOpenGL::SetDisplay | ( | deDisplay * | Display | ) | `[virtual]`

  | Set the display up, creating a new internal render device Parameters:
  Display | [in] user-defined display settings, may not be NULL
Implements deDriver.

deBoolean deOpenGL::SetFOVClipping | ( | deFloat | FOV,
|  | deFloat | Aspect,
|  | deFloat | ClipNear,
|  | deFloat | ClipFar
| ) | `[virtual]`

| Set up a perspective view transformation. Implements deDriver.

deBoolean deOpenGL::SetFOVClippingSubRect | ( | deFloat | FOVY,
|  | deFloat | Aspect,
|  | deFloat | ClipNear,
|  | deFloat | ClipFar,
|  | deRect | SubRect
| ) | `[virtual]`

| Set up a perspective view transformation with a sub-rect specified in the [0,1] range. Implements deDriver.

deBoolean deOpenGL::SetFOVClippingSubRectFloat | ( | deFloat | FOVY,
|  | deFloat | Aspect,
|  | deFloat | ClipNear,
|  | deFloat | ClipFar,
|  | deFloatRect | SubRect
| ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetLightState | ( | IdeRenderLight * | State | ) | `[private]`

deBoolean deOpenGL::SetMaterialState | ( | IdeRenderMaterial * | State | ) | `[private]`

deBoolean deOpenGL::SetOrthoClipping | ( | deFloat | Width,
|  | deFloat | Height,
|  | deFloat | ClipNear,
|  | deFloat | ClipFar,
|  | deBoolean | Invert = deFALSE
| ) | `[virtual]`

| Set up an orthographic (parallel projection) view transformation. Implements deDriver.

deBoolean deOpenGL::SetOrthoClippingSubRect | ( | deFloat | Width,
|  | deFloat | Height,
|  | deFloat | ClipNear,
|  | deFloat | ClipFar,
|  | deBoolean | Invert,
|  | deRect | SubRect
| ) | `[virtual]`

| Set up an orthographic (parallel projection) view transformation with a sub-rect specified in the [0,1] range. Implements deDriver.

deBoolean deOpenGL::SetOrthoClippingSubRectFloat | ( | deFloat | Width,
|  | deFloat | Height,
|  | deFloat | ClipNear,
|  | deFloat | ClipFar,
|  | deBoolean | Invert,
|  | deFloatRect | SubRect
| ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetRenderState | ( | RenderState | State,
|  | unsigned long | Value
| ) | `[virtual]`

| Set a value-based render-state. Implements deDriver.

deBoolean deOpenGL::SetRenderState | ( | const IdeRenderState * | State | ) | `[virtual]`

| Set a class-based render-state (texture, material, or light). Implements deDriver.

deBoolean deOpenGL::SetShader | ( | IdeShader * | Shader | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetTextureState | ( | IdeRenderTexture * | State | ) | `[private]`

deBoolean deOpenGL::SetTextureTransform | ( | long | StageNum,
|  | deTransformInfo * | Mat
| ) | `[virtual]`

| Set the texture transform for a particular stage. Implements IdeDriver.

void deOpenGL::SetVertexBuffer | ( | VertexBufferEntry * | VertexBufferInfo | ) | `[private]`

deBoolean deOpenGL::SetViewport | ( | long | X,
|  | long | Y,
|  | long | Width,
|  | long | Height,
|  | deFloat | MinZ,
|  | deFloat | MaxZ
| ) | `[virtual]`

| Set the screen-space viewport. Implements deDriver.

deBoolean deOpenGL::SetWorldRotation | ( | deVertex * | Rotation | ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetWorldTransform | ( | deVertex * | Eye,
|  | deVertex * | At,
|  | deVertex * | Up
| ) | `[virtual]`

| Implements deDriver.

deBoolean deOpenGL::SetWorldTransform | ( | deTransformInfo * | M | ) | `[virtual]`

| Set the world transform (to take things from "object space" to "world space"). Implements deDriver.

deBoolean deOpenGL::SetWorldTranslation | ( | deVertex * | Translation | ) | `[virtual]`

| Implements deDriver.

void deOpenGL::Shutdown | ( |  | ) | `[private]`

deBoolean deOpenGL::ToGLBPP | ( | IdeDriver::BPP | BPPType,
|  | GLint * | InternalFormat,
|  | GLenum * | Format,
|  | GLenum * | Type
| ) | const`[private]`

deBoolean deOpenGL::UpdateVertexBuffer | ( | IdeVertexBuffer * | Vertex | ) | `[virtual]`

| Update a vertex buffer so the driver's internal data matches it. Implements deDriver.

deBoolean deOpenGL::ValidFormat | ( | long | Adapter,
|  | Resource | ResourceType,
|  | BPP | BPPType,
|  | ZPP | ZPPType,
|  | BPP | FrontBuffer,
|  | long | ExtraFlag = 0
| ) | const`[virtual]`

| Test for a valid format for various resource types. Implements deDriver.

deBoolean deOpenGL::WindowedAllowed | ( | long | Adapter | ) | const`[virtual]`

| Test whether windowed mode is allowed on a particular adapter. Implements deDriver.

## Member Data Documentation

GLenum deOpenGL::AlphaFunction`[private]`

GLclampf deOpenGL::AlphaRef`[private]`

HDC deOpenGL::DC`[private]`

GLenum deOpenGL::DestBlendFactor`[private]`

int deOpenGL::m_AdapterCount`[private]`

deDriverCaps* deOpenGL::m_Caps`[private]`

int* deOpenGL::m_ModeCount`[private]`

deDisplay** deOpenGL::m_Modes`[private]`

deTHashInt<IdeBitmap*> deOpenGL::m_TexturesList`[private]`

deTHashInt<IdeVertexBuffer*> deOpenGL::m_VBufferList`[private]`

deBoolean* deOpenGL::m_WindowPossible`[private]`

GLenum deOpenGL::MirroredTextureWrapFlag`[private]`

deBoolean deOpenGL::NVVertexProgramExt`[private]`

HGLRC deOpenGL::RC`[private]`

deBoolean deOpenGL::RenderStatesValid`[private]`

GLenum deOpenGL::SrcBlendFactor`[private]`

The documentation for this class was generated from the following files:

- DOpenGL.hpp
- DOpenGL-RenderStates.cpp
- DOpenGL-Windows.cpp
- DOpenGL.cpp