pbuffer.h
来自「PDE simulator on GPU.」· C头文件 代码 · 共 61 行
H
61 行
#ifndef PBUFFERS_H
#define PBUFFERS_H
#include <windows.h>
#include "extgl.h"
#define MAX_ATTRIBS 256
#define MAX_PFORMATS 256
class CFloatPBuffer
{
public: // interface
CFloatPBuffer(int iWidth, int iHeight);
~CFloatPBuffer();
//! Call this once before use. Set bShare to true to share lists, textures,
//! and program objects between the render texture context and the
//! current active GL context.
bool Initialize();
// !Begin drawing to the texture. (i.e. use as "output" texture)
bool BeginCapture();
// !End drawing to the texture.
bool EndCapture();
void Activate();
void InActivate();
//! Returns the width of the offscreen buffer.
int GetWidth() const { return _iWidth; }
//! Returns the width of the offscreen buffer.
int GetHeight() const { return _iHeight; }
HGLRC _hGLContext; // Handle to a GL context.
///
HPBUFFERARB GetHandle() const { return _hPBuffer;}
//////Query the supported pixel format
void QueryFormatInfo(int format,int *pformat,unsigned int nformats,int *iattributes);
void HandleModeSwitch();
protected: // data
int _iWidth; // width of the pbuffer
int _iHeight; // height of the pbuffer
bool _bInitialized;
HDC _hDC; // Handle to a device context.
HPBUFFERARB _hPBuffer; // Handle to a pbuffer.
HDC _hPreviousDC;
HGLRC _hPreviousContext;
};
bool IsPowerOfTwo(int n);
///////////////////////////////////////////////////////////////////////////////////////
//// GLOBAL variable for all use
extern CFloatPBuffer *resultBuffer;
extern CFloatPBuffer *pbuffer[10];
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?