git-svn-id: svn://db.shs.com.ru/libs@290 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -33,6 +33,12 @@ foreach(_Q ${_QAD_LIBS})
|
|||||||
#message(STATUS "Library ${_Q} (${_QU}) -> ${QAD_${_QU}_LIBRARY} found in ${_SEARCH_DIR}")
|
#message(STATUS "Library ${_Q} (${_QU}) -> ${QAD_${_QU}_LIBRARY} found in ${_SEARCH_DIR}")
|
||||||
list(APPEND QT_MULTILIB_LIST qad_${_Q})
|
list(APPEND QT_MULTILIB_LIST qad_${_Q})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
list(APPEND QT_MULTILIB_LIST qglview)
|
||||||
|
foreach(_v ${_QT_VERSIONS_})
|
||||||
|
find_library(QGLVIEW${_v}_LIBRARY qglview${_v} ${_SEARCH_DIR})
|
||||||
|
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v})
|
||||||
|
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
|
||||||
|
endforeach()
|
||||||
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
|
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
|
||||||
if(NOT LIBPROJECT)
|
if(NOT LIBPROJECT)
|
||||||
if (NOT _QAD_MSG)
|
if (NOT _QAD_MSG)
|
||||||
|
|||||||
@@ -17,7 +17,16 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@@ -30,8 +39,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>-10</x>
|
<x>-10</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>28</width>
|
<width>33</width>
|
||||||
<height>361</height>
|
<height>420</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="layoutButtons">
|
<layout class="QVBoxLayout" name="layoutButtons">
|
||||||
@@ -47,12 +56,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/zoom-fit-best.png</normaloff>:/icons/zoom-fit-best.png</iconset>
|
<normaloff>:/icons/zoom-fit-best.png</normaloff>:/icons/zoom-fit-best.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -64,12 +67,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/view-grid.png</normaloff>:/icons/view-grid.png</iconset>
|
<normaloff>:/icons/view-grid.png</normaloff>:/icons/view-grid.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -87,12 +84,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/edit-guides.png</normaloff>:/icons/edit-guides.png</iconset>
|
<normaloff>:/icons/edit-guides.png</normaloff>:/icons/edit-guides.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -107,12 +98,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/expand_s_y.png</normaloff>:/icons/expand_s_y.png</iconset>
|
<normaloff>:/icons/expand_s_y.png</normaloff>:/icons/expand_s_y.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -127,12 +112,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/expand_s_x.png</normaloff>:/icons/expand_s_x.png</iconset>
|
<normaloff>:/icons/expand_s_x.png</normaloff>:/icons/expand_s_x.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -147,12 +126,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/view-fullscreen.png</normaloff>:/icons/view-fullscreen.png</iconset>
|
<normaloff>:/icons/view-fullscreen.png</normaloff>:/icons/view-fullscreen.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -164,12 +137,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/border-line.png</normaloff>:/icons/border-line.png</iconset>
|
<normaloff>:/icons/border-line.png</normaloff>:/icons/border-line.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -187,12 +154,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/legend.png</normaloff>:/icons/legend.png</iconset>
|
<normaloff>:/icons/legend.png</normaloff>:/icons/legend.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -210,12 +171,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset>
|
<normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -230,12 +185,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
|
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -247,12 +196,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -280,12 +223,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -297,12 +234,6 @@
|
|||||||
<iconset resource="qad_graphic.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/dialog-close.png</normaloff>:/icons/dialog-close.png</iconset>
|
<normaloff>:/icons/dialog-close.png</normaloff>:/icons/dialog-close.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -350,7 +281,16 @@
|
|||||||
<enum>QFrame::Sunken</enum>
|
<enum>QFrame::Sunken</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="2" column="1" colspan="2">
|
<item row="2" column="1" colspan="2">
|
||||||
@@ -365,7 +305,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@@ -417,7 +366,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@@ -455,12 +413,21 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="layoutLegend">
|
<layout class="QGridLayout" name="layoutLegend">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
<property name="horizontalSpacing">
|
<property name="horizontalSpacing">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>448</width>
|
<width>492</width>
|
||||||
<height>513</height>
|
<height>585</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -20,7 +20,16 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@@ -35,7 +44,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@@ -142,7 +160,16 @@
|
|||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
@@ -254,7 +281,16 @@
|
|||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
@@ -390,7 +426,16 @@
|
|||||||
<string>Margins</string>
|
<string>Margins</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
|||||||
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets ${OPENGL_LIBRARIES})
|
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets ${OPENGL_LIBRARIES})
|
||||||
message(STATUS "Building ${PROJECT_NAME}")
|
message(STATUS "Building ${PROJECT_NAME}")
|
||||||
if (LIBPROJECT)
|
if (LIBPROJECT)
|
||||||
sdk_install("qad" "${PROJECT_NAME}" "${H}")
|
sdk_install("qad" "${PROJECT_NAME}" "${out_HDR}")
|
||||||
else()
|
else()
|
||||||
if (LIB)
|
if (LIB)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ void GLCubeTexture::loadPathesFromDirectory(const QString & dir) {
|
|||||||
|
|
||||||
|
|
||||||
GLuint GLTextureManagerBase::loadTexture(const QString & path, bool ownership, bool bump) {
|
GLuint GLTextureManagerBase::loadTexture(const QString & path, bool ownership, bool bump) {
|
||||||
|
if (!currentGLTextureManager) return 0;
|
||||||
QString p = findFile(path, search_pathes);
|
QString p = findFile(path, search_pathes);
|
||||||
if (p.isEmpty()) return 0;
|
if (p.isEmpty()) return 0;
|
||||||
int tid = ((GLTextureManagerBase*)currentGLTextureManager)->textureID(p, bump);
|
int tid = ((GLTextureManagerBase*)currentGLTextureManager)->textureID(p, bump);
|
||||||
@@ -225,7 +226,8 @@ void Material::apply(__GLShaderProgram__ * prog) {
|
|||||||
|
|
||||||
void Material::loadTextures(GLTextureManagerBase * tm) {
|
void Material::loadTextures(GLTextureManagerBase * tm) {
|
||||||
//qDebug() << "load textures";
|
//qDebug() << "load textures";
|
||||||
if (tm == 0) tm = (GLTextureManagerBase*)currentGLTextureManager;
|
if (!tm) tm = (GLTextureManagerBase*)currentGLTextureManager;
|
||||||
|
if (!tm) return;
|
||||||
if (!map_diffuse.bitmap_path.isEmpty()) map_diffuse.bitmap_id = tm->loadTexture(map_diffuse.bitmap_path);
|
if (!map_diffuse.bitmap_path.isEmpty()) map_diffuse.bitmap_id = tm->loadTexture(map_diffuse.bitmap_path);
|
||||||
if (!map_normal.bitmap_path.isEmpty()) map_normal.bitmap_id = tm->loadTexture(map_normal.bitmap_path, true, true);
|
if (!map_normal.bitmap_path.isEmpty()) map_normal.bitmap_id = tm->loadTexture(map_normal.bitmap_path, true, true);
|
||||||
if (!map_relief.bitmap_path.isEmpty()) map_relief.bitmap_id = tm->loadTexture(map_relief.bitmap_path);
|
if (!map_relief.bitmap_path.isEmpty()) map_relief.bitmap_id = tm->loadTexture(map_relief.bitmap_path);
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ QMatrix4x4 getGLMatrix(GLenum matrix);
|
|||||||
void setGLMatrix(QMatrix4x4 matrix);
|
void setGLMatrix(QMatrix4x4 matrix);
|
||||||
inline void deleteGLTexture(GLuint & tex) {if (tex != 0) glDeleteTextures(1, &tex); tex = 0;}
|
inline void deleteGLTexture(GLuint & tex) {if (tex != 0) glDeleteTextures(1, &tex); tex = 0;}
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
# define QGLCI QOpenGLExtraFunctions gf(QOpenGLContext::currentContext());
|
# define QGLCI if (!QOpenGLContext::currentContext()) return; QOpenGLExtraFunctions gf(QOpenGLContext::currentContext());
|
||||||
# define QGLC gf.
|
# define QGLC gf.
|
||||||
inline void glActiveTextureChannel(int channel) {QGLCI gf.glActiveTexture(GL_TEXTURE0 + channel);}
|
inline void glActiveTextureChannel(int channel) {QGLCI gf.glActiveTexture(GL_TEXTURE0 + channel);}
|
||||||
inline void glDisableTextures(int channels = 8) {QGLCI for (int i = channels - 1; i >= 0; --i) {glActiveTextureChannel(i); glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_CUBE_MAP);}}
|
inline void glDisableTextures(int channels = 8) {QGLCI for (int i = channels - 1; i >= 0; --i) {glActiveTextureChannel(i); glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_CUBE_MAP);}}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ QGLView::QGLView(QWidget * parent): QGraphicsView(parent), fbo_selection(3) {
|
|||||||
setFocusPolicy(Qt::WheelFocus);
|
setFocusPolicy(Qt::WheelFocus);
|
||||||
setScene(new QGraphicsScene());
|
setScene(new QGraphicsScene());
|
||||||
setInteractive(true);
|
setInteractive(true);
|
||||||
|
need_init_ = true;
|
||||||
objects_.is_root = true;
|
objects_.is_root = true;
|
||||||
painter_ = 0;
|
painter_ = 0;
|
||||||
backColor_ = Qt::black;
|
backColor_ = Qt::black;
|
||||||
@@ -108,8 +109,11 @@ QGLView::QGLView(QWidget * parent): QGraphicsView(parent), fbo_selection(3) {
|
|||||||
|
|
||||||
|
|
||||||
QGLView::~QGLView() {
|
QGLView::~QGLView() {
|
||||||
|
stop();
|
||||||
if (shader_select != 0) delete shader_select;
|
if (shader_select != 0) delete shader_select;
|
||||||
if (shader_halo != 0) delete shader_halo;
|
if (shader_halo != 0) delete shader_halo;
|
||||||
|
currentQGLView = 0;
|
||||||
|
currentGLTextureManager = 0;
|
||||||
//if (shader_rope != 0) delete shader_rope;
|
//if (shader_rope != 0) delete shader_rope;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,12 +163,13 @@ void QGLView::drawBackground(QPainter * painter, const QRectF & rect) {
|
|||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
glReleaseTextures();
|
glReleaseTextures();
|
||||||
QGraphicsView::drawBackground(painter_, rect);
|
QGraphicsView::drawBackground(painter_, rect);
|
||||||
|
painter_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QGLView::initializeGL() {
|
void QGLView::initializeGL() {
|
||||||
//qDebug() << "init glview";
|
//qDebug() << "init glview";
|
||||||
makeCurrent();
|
//makeCurrent();
|
||||||
#if QT_VERSION >= 0x050600
|
#if QT_VERSION >= 0x050600
|
||||||
initializeOpenGLFunctions();
|
initializeOpenGLFunctions();
|
||||||
#endif
|
#endif
|
||||||
@@ -216,11 +221,18 @@ void QGLView::initializeGL() {
|
|||||||
//createGLTexture(t, QImage("e/bottom.jpg"));
|
//createGLTexture(t, QImage("e/bottom.jpg"));
|
||||||
//qDebug() << bindTexture(QImage("e/bottom.jpg"));
|
//qDebug() << bindTexture(QImage("e/bottom.jpg"));
|
||||||
|
|
||||||
|
need_init_ = false;
|
||||||
emit glInitializeDone();
|
emit glInitializeDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QGLView::paintGL() {
|
void QGLView::paintGL() {
|
||||||
|
#if QT_VERSION >= 0x050600
|
||||||
|
//initializeOpenGLFunctions();
|
||||||
|
if (need_init_)
|
||||||
|
initializeGL();
|
||||||
|
#endif
|
||||||
|
//qDebug() << "paintGL";
|
||||||
//QMutexLocker ml_v(&v_mutex);
|
//QMutexLocker ml_v(&v_mutex);
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
//glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
@@ -308,6 +320,7 @@ void QGLView::paintGL() {
|
|||||||
renderer_->prepareScene();
|
renderer_->prepareScene();
|
||||||
renderer_->renderScene();
|
renderer_->renderScene();
|
||||||
}
|
}
|
||||||
|
emit glPainting();
|
||||||
if (selectionHalo_ || hoverHalo_) {
|
if (selectionHalo_ || hoverHalo_) {
|
||||||
glReleaseTextures();
|
glReleaseTextures();
|
||||||
glReleaseShaders();
|
glReleaseShaders();
|
||||||
@@ -342,7 +355,7 @@ void QGLView::paintGL() {
|
|||||||
glResetAllTransforms();
|
glResetAllTransforms();
|
||||||
glReleaseFramebuffer();
|
glReleaseFramebuffer();
|
||||||
|
|
||||||
emit glPainting();
|
emit glEndPaint();
|
||||||
|
|
||||||
/*releaseShaders();
|
/*releaseShaders();
|
||||||
glActiveTextureChannel(0);
|
glActiveTextureChannel(0);
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ private:
|
|||||||
double fogDensity_, fogStart_, fogEnd_, fps_, fps_tm, hoverHaloFill_, selectionHaloFill_, m_motionBlurFactor;
|
double fogDensity_, fogStart_, fogEnd_, fps_, fps_tm, hoverHaloFill_, selectionHaloFill_, m_motionBlurFactor;
|
||||||
int timer, fps_cnt, sh_id_loc;
|
int timer, fps_cnt, sh_id_loc;
|
||||||
bool is_init, fogEnabled_, lightEnabled_, grabMouse_, mouse_first, mouseRotate_, mouseSelect_, customMouseMove_;
|
bool is_init, fogEnabled_, lightEnabled_, grabMouse_, mouse_first, mouseRotate_, mouseSelect_, customMouseMove_;
|
||||||
bool shaders_supported, changed_, cameraOrbit_;
|
bool shaders_supported, changed_, cameraOrbit_, need_init_;
|
||||||
bool hoverHalo_, selectionHalo_, mouseThis_, shaders_bind, selecting_;
|
bool hoverHalo_, selectionHalo_, mouseThis_, shaders_bind, selecting_;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@@ -305,6 +305,7 @@ public slots:
|
|||||||
signals:
|
signals:
|
||||||
void glBeginPaint();
|
void glBeginPaint();
|
||||||
void glPainting();
|
void glPainting();
|
||||||
|
void glEndPaint();
|
||||||
void glKeyPressEvent(QKeyEvent * e);
|
void glKeyPressEvent(QKeyEvent * e);
|
||||||
void glKeyReleaseEvent(QKeyEvent * e);
|
void glKeyReleaseEvent(QKeyEvent * e);
|
||||||
void glMousePressEvent(QMouseEvent * e);
|
void glMousePressEvent(QMouseEvent * e);
|
||||||
|
|||||||
@@ -88,13 +88,13 @@ void RendererDeferredShading::renderScene() {
|
|||||||
fbo_g.bind();
|
fbo_g.bind();
|
||||||
int buffs[] = {0, 1, 2, 3, 4};
|
int buffs[] = {0, 1, 2, 3, 4};
|
||||||
fbo_g.setWriteBuffers(buffs, 5);
|
fbo_g.setWriteBuffers(buffs, 5);
|
||||||
if (white_image_id == 0) {
|
if (white_image_id == 0 && currentGLTextureManager) {
|
||||||
glActiveTextureChannel(6);
|
glActiveTextureChannel(6);
|
||||||
white_image_id = ((GLTextureManagerBase*)currentGLTextureManager)->loadTexture(white_image, false);
|
white_image_id = ((GLTextureManagerBase*)currentGLTextureManager)->loadTexture(white_image, false);
|
||||||
glBindTexture(GL_TEXTURE_2D, white_image_id);
|
glBindTexture(GL_TEXTURE_2D, white_image_id);
|
||||||
glActiveTextureChannel(0);
|
glActiveTextureChannel(0);
|
||||||
}
|
}
|
||||||
if (violent_image_id == 0) {
|
if (violent_image_id == 0 && currentGLTextureManager) {
|
||||||
glActiveTextureChannel(7);
|
glActiveTextureChannel(7);
|
||||||
violent_image_id = ((GLTextureManagerBase*)currentGLTextureManager)->loadTexture(violent_image, false);
|
violent_image_id = ((GLTextureManagerBase*)currentGLTextureManager)->loadTexture(violent_image, false);
|
||||||
glBindTexture(GL_TEXTURE_2D, violent_image_id);
|
glBindTexture(GL_TEXTURE_2D, violent_image_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user