mirror of
https://github.com/leozide/leocad.git
synced 2026-07-28 04:07:11 +00:00
Switch to QOpenGLWidget.
This commit is contained in:
+19
-5
@@ -107,23 +107,33 @@ enum class lcPolygonOffset
|
||||
Translucent
|
||||
};
|
||||
|
||||
#ifdef LC_USE_QOPENGLWIDGET
|
||||
class lcContext : protected QOpenGLFunctions
|
||||
#else
|
||||
class lcContext
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
lcContext();
|
||||
~lcContext();
|
||||
|
||||
lcContext(const lcContext&) = delete;
|
||||
lcContext(lcContext&&) = delete;
|
||||
lcContext& operator=(const lcContext&) = delete;
|
||||
lcContext& operator=(lcContext&&) = delete;
|
||||
|
||||
static void CreateResources();
|
||||
static void DestroyResources();
|
||||
void CreateResources();
|
||||
void DestroyResources();
|
||||
|
||||
void SetDefaultState();
|
||||
void ClearResources();
|
||||
|
||||
#ifdef LC_USE_QOPENGLWIDGET
|
||||
void SetGLContext(QOpenGLContext* GLContext)
|
||||
{
|
||||
initializeOpenGLFunctions();
|
||||
mGLContext = GLContext;
|
||||
}
|
||||
#endif
|
||||
|
||||
void SetWorldMatrix(const lcMatrix44& WorldMatrix)
|
||||
{
|
||||
mWorldMatrix = WorldMatrix;
|
||||
@@ -219,9 +229,13 @@ public:
|
||||
void BindMesh(const lcMesh* Mesh);
|
||||
|
||||
protected:
|
||||
static void CreateShaderPrograms();
|
||||
void CreateShaderPrograms();
|
||||
void FlushState();
|
||||
|
||||
#ifdef LC_USE_QOPENGLWIDGET
|
||||
QOpenGLContext* mGLContext = nullptr;
|
||||
#endif
|
||||
|
||||
GLuint mVertexBufferObject;
|
||||
GLuint mIndexBufferObject;
|
||||
char* mVertexBufferPointer;
|
||||
|
||||
Reference in New Issue
Block a user