Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
C-Fu
OpenGL
Commits
8cf86a41
Commit
8cf86a41
authored
Dec 09, 2016
by
Anakin
Browse files
Added new Project using Qt,
There is garbage left from Qt??
parent
1c5a33cf
Changes
9
Hide whitespace changes
Inline
Side-by-side
MeshViewerQt/Form Files/MainWindow.ui
0 → 100644
View file @
8cf86a41
<UI version="4.0" >
<class>MainWindowClass</class>
<widget class="QMainWindow" name="MainWindowClass" >
<property name="objectName" >
<string notr="true">MainWindowClass</string>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle" >
<string>MainWindow</string>
</property>
<widget class="QMenuBar" name="menuBar" />
<widget class="QToolBar" name="mainToolBar" />
<widget class="QWidget" name="centralWidget" />
<widget class="QStatusBar" name="statusBar" />
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources>
<include location="MainWindow.qrc"/>
</resources>
<connections/>
</UI>
MeshViewerQt/Header/MainWindow.h
0 → 100644
View file @
8cf86a41
#pragma once
#include
<QtWidgets/QMainWindow>
#include
"ui_MainWindow.h"
class
MainWindow
:
public
QMainWindow
{
Q_OBJECT
public:
MainWindow
(
QWidget
*
parent
=
Q_NULLPTR
);
~
MainWindow
();
private:
Ui
::
MainWindowClass
*
ui
;
void
setupWindow
();
protected:
virtual
void
keyPressEvent
(
QKeyEvent
*
keyEvent
)
override
final
;
};
MeshViewerQt/Header/OpenGlViewer.h
0 → 100644
View file @
8cf86a41
#pragma once
#include
<QOpenGLWidget>
#include
<QOpenGLFunctions>
class
OpenGlViewer
:
public
QOpenGLWidget
,
protected
QOpenGLFunctions
{
Q_OBJECT
public:
OpenGlViewer
(
QWidget
*
parent
);
~
OpenGlViewer
();
protected:
virtual
void
initializeGL
()
override
final
;
virtual
void
resizeGL
(
int
w
,
int
h
)
override
final
;
virtual
void
paintGL
()
override
final
;
};
MeshViewerQt/Header/defines.h
0 → 100644
View file @
8cf86a41
#pragma once
#define WINDOW_NAME "Mesh Viewer"
#define WINDOW_WIDTH 640
#define WINDOW_HEIGHT 480
#define DEFAULT_STATUS_MESSAGE "Mesh Viewer pre alpha by Anakin"
#define DEFAULT_MAJOR_VERSION 4
#define DEFAULT_MINOR_VERSION 5
#define DEAFAULT_BACKGROUND 0.5000f, 0.8000f, 1.0000f, 0.0000f
MeshViewerQt/Resources/MainWindow.qrc
0 → 100644
View file @
8cf86a41
<RCC>
<qresource prefix="/MainWindow">
<file>icon.ico</file>
</qresource>
</RCC>
MeshViewerQt/Resources/icon.ico
0 → 100644
View file @
8cf86a41
264 KB
MeshViewerQt/Source/MainWindow.cpp
0 → 100644
View file @
8cf86a41
#include
"MainWindow.h"
#include
"OpenGlViewer.h"
#include
"defines.h"
#include
<QKeyEvent>
MainWindow
::
MainWindow
(
QWidget
*
parent
)
:
QMainWindow
(
parent
)
,
ui
(
new
Ui
::
MainWindowClass
)
{
setupWindow
();
}
MainWindow
::~
MainWindow
()
{
delete
ui
;
}
void
MainWindow
::
setupWindow
()
{
ui
->
setupUi
(
this
);
this
->
setWindowTitle
(
WINDOW_NAME
);
this
->
setWindowIcon
(
QIcon
(
":/MainWindow/icon.ico"
));
this
->
resize
(
WINDOW_WIDTH
,
WINDOW_HEIGHT
);
this
->
setCentralWidget
(
new
OpenGlViewer
(
this
));
ui
->
statusBar
->
showMessage
(
DEFAULT_STATUS_MESSAGE
);
}
void
MainWindow
::
keyPressEvent
(
QKeyEvent
*
keyEvent
)
{
switch
(
keyEvent
->
key
())
{
case
Qt
::
Key
::
Key_Escape
:
close
();
break
;
}
QMainWindow
::
keyPressEvent
(
keyEvent
);
}
MeshViewerQt/Source/OpenGlViewer.cpp
0 → 100644
View file @
8cf86a41
#include
"OpenGlViewer.h"
#include
"defines.h"
OpenGlViewer
::
OpenGlViewer
(
QWidget
*
parent
)
:
QOpenGLWidget
(
parent
)
{
QSurfaceFormat
format
;
format
.
setVersion
(
DEFAULT_MAJOR_VERSION
,
DEFAULT_MINOR_VERSION
);
format
.
setProfile
(
QSurfaceFormat
::
CoreProfile
);
this
->
setFormat
(
format
);
}
OpenGlViewer
::~
OpenGlViewer
()
{
}
void
OpenGlViewer
::
initializeGL
()
{
initializeOpenGLFunctions
();
glClearColor
(
DEAFAULT_BACKGROUND
);
}
void
OpenGlViewer
::
resizeGL
(
int
w
,
int
h
)
{
//TODO: change perspective
}
void
OpenGlViewer
::
paintGL
()
{
//TODO: paint here
}
MeshViewerQt/main.cpp
0 → 100644
View file @
8cf86a41
#include
"MainWindow.h"
#include
<QtWidgets/QApplication>
int
startGUI
(
int
argc
,
char
*
argv
[])
{
QApplication
a
(
argc
,
argv
);
MainWindow
w
;
w
.
show
();
return
a
.
exec
();
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
exitstatus
=
startGUI
(
argc
,
argv
);
return
exitstatus
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment