JSRUN 用代码说话

CARenderImage(图像渲染)

编辑教程

CARenderImage(图像渲染)

类说明

图像渲染

CARenderImage 方法

方法 说明
visit 访问
draw 显示
create 创建,指定Format和DepthStencilFormat
create 创建,指定Format
create 创建
initWithWidthAndHeight 初始化指定格Format
initWithWidthAndHeight 初始化指定格Format和DepthStencilFormat
printscreenWithView 截图并指定view
printscreenWithView 截图并指定view和offset
printscreenWithView 截图并指定view和backgroundColor
printscreenWithView 截图并指定view、offset和backgroundColor
clear 清除背景颜色
clearDepth 清除depthValue
clearStencil 清除Stencil
saveToFile 保存到文件
listenToBackground 监听背景
listenToForeground 监听前景
getClearFlags 获取清除的标志
setClearFlags 设置清除的标志
getClearColor 获取清除的颜色
setClearColor 设置清除的颜色
getClearDepth 获取清除的深度
setClearDepth 设置清除的深度
getClearStencil 获取清除的模板
setClearStencil 设置清除的模板
isAutoDraw 查看是否自动显示
setAutoDraw 设置自动显示

CARenderImage 方法说明

virtual void visit();

返回值:void

参数:

解释:访问

virtual void draw();

返回值:void

参数:

解释:显示

static CARenderImage* create(int w ,int h, CAImage::PixelFormat eFormat, GLuint uDepthStencilFormat);

返回值:CARenderImage*

参数:

类型 参数名 说明
int w Width
int h height
CAImage::PixelFormat eFormat 格式
GLuint uDepthStencilFormat DepthStencilFormat

解释:创建,指定Format和DepthStencilFormat

static CARenderImage* create(int w, int h, CAImage::PixelFormat eFormat);

返回值:CARenderImage*

参数:

类型 参数名 说明
int w Width
int h height
CAImage::PixelFormat eFormat 格式

解释:创建,指定Format

static CARenderImage* create(int w, int h);

返回值:CARenderImage*

参数:

类型 参数名 说明
int w Width
int h height

解释:创建

bool initWithWidthAndHeight(int w, int h, CAImage::PixelFormat eFormat);

返回值:bool

参数:

类型 参数名 说明
int w Width
int h height
CAImage::PixelFormat eFormat 格式

解释:初始化指定格Format

bool initWithWidthAndHeight(int w, int h, CAImage::PixelFormat eFormat, GLuint uDepthStencilFormat);

返回值:bool

参数:

类型 参数名 说明
int w Width
int h height
CAImage::PixelFormat eFormat 格式
GLuint uDepthStencilFormat DepthStencilFormat

解释:初始化指定格Format和DepthStencilFormat

void printscreenWithView(CAView* view);

返回值:void

参数:

类型 参数名 说明
CAView* view 图像

解释:截图并指定view

void printscreenWithView(CAView* view, DPoint offset);

返回值:void

参数:

类型 参数名 说明
CAView* view 图像
DPoint offset offset

解释:截图并指定view和offset

void printscreenWithView(CAView* view, const CAColor4B& backgroundColor);

返回值:void

参数:

类型 参数名 说明
CAView* view 图像
const CAColor4B& backgroundColor 背景颜色

解释:截图并指定view和backgroundColor

void printscreenWithView(CAView* view, DPoint offset, const CAColor4B& backgroundColor);

返回值:void

参数:

类型 参数名 说明
CAView* view 图像
DPoint offset offset
const CAColor4B& backgroundColor 背景颜色

解释:截图并指定view、offset和backgroundColor

void clear(const CAColor4B& backgroundColor);

返回值:void

参数:

类型 参数名 说明
const CAColor4B& backgroundColor 背景颜色

解释:清除背景颜色

void clearDepth(float depthValue);

返回值:void

参数:

类型 参数名 说明
float depthValue depthValue

解释:清除depthValue

void clearStencil(int stencilValue);

返回值:void

参数:

类型 参数名 说明
int stencilValue stencilValue

解释:清除Stencil

bool saveToFile(const char* szFilePath);

返回值:bool

参数:

类型 参数名 说明
const char * szFilePath 文件

解释:保存到文件

void listenToBackground(CAObject *obj);

返回值:void

参数:

类型 参数名 说明
CAObject* obj obj

解释:监听背景

void listenToForeground(CAObject *obj);

返回值:void

参数:

类型 参数名 说明
CAObject* obj obj

解释:监听前景

unsigned int getClearFlags() const;

返回值:unsigned int

参数:

解释:获取清除的标志

void setClearFlags(unsigned int uClearFlags);

返回值:void

参数:

类型 参数名 说明
unsigned int uClearFlags 标志

解释:设置清除的标志

const CAColor4F& getClearColor() const;

返回值:const CAColor4F&

参数:

解释:获取清除的颜色

void setClearColor(const CAColor4F &clearColor);

返回值:void

参数:

类型 参数名 说明
const CAColor4F& clearColor 颜色

解释:设置清除的颜色

float getClearDepth() const;

返回值:float

参数:

解释:获取清除的深度

void setClearDepth(float fClearDepth);

返回值:void

参数:

类型 参数名 说明
float fClearDepth Depth

解释:设置清除的深度

int getClearStencil() const;

返回值:int

参数:

解释:获取清除的模板

void setClearStencil(float fClearStencil);

返回值:void

参数:

类型 参数名 说明
float fClearStencil Stencil

解释:设置清除的模板

bool isAutoDraw() const;

返回值:bool

参数:

解释:查看是否自动显示

void setAutoDraw(bool bAutoDraw);

返回值:void

参数:

类型 参数名 说明
bool bAutoDraw 自动显示

解释:设置自动显示

JSRUN闪电教程系统是国内最先开创的教程维护系统, 所有工程师都可以参与共同维护的闪电教程,让知识的积累变得统一完整、自成体系。 大家可以一起参与进共编,让零散的知识点帮助更多的人。
X
支付宝
9.99
无法付款,请点击这里
金额: 0
备注:
转账时请填写正确的金额和备注信息,到账由人工处理,可能需要较长时间
如有疑问请联系QQ:565830900
正在生成二维码, 此过程可能需要15秒钟