5 Star 8 Fork 3

jeffy/CocosQtPort

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CCQGLView.h 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
jeffy 提交于 2015-02-28 00:23 +08:00 . submit full code.
#pragma once
#include "cocos2d.h"
#include <QMouseEvent>
#include <QWidget>
typedef void(*KEY_PTRFUN)(QKeyEvent *event);
class CCQGLWidget;
NS_CC_BEGIN
class CCQGLView : public GLViewImpl
{
public:
CCQGLView();
virtual ~CCQGLView();
/* override functions */
virtual bool isOpenGLReady() override;
virtual void end() override;
virtual void swapBuffers() override;
virtual void setFrameSize(float width, float height) override;
virtual void setIMEKeyboardState(bool bOpen) override;
virtual void setViewName(const char* pszViewName);
/* Qt functions */
void mouseMove(QMouseEvent *event);
void mousePress(QMouseEvent *event);
void mouseRelease(QMouseEvent *event);
void wheel(QWheelEvent *event);
QWidget * getGLWidget();
void resize(); // auto adjust frame size according to current window size
void updateWindowSize();
void setBgColor(Color4B &color);
/* get the shared main open gl window */
static CCQGLView* getInstance();
private:
virtual bool Create();
bool _isInit;
float _screenScaleFactor;
float _lastWindowHeight;
Color4F _bgColor;
CCQGLWidget* _window;
};
NS_CC_END
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/takamachimarisa/CocosQtPort.git
git@gitee.com:takamachimarisa/CocosQtPort.git
takamachimarisa
CocosQtPort
CocosQtPort
master

搜索帮助