Added missing texture for Qt plugin. It now builds properly on windows, but doesn't render in my VM...

develop
Petr Mrázek 2011-07-16 20:17:03 +02:00
parent d6d108dd34
commit fdff604a44
4 changed files with 8 additions and 5 deletions

@ -12,7 +12,7 @@ if(QT4_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND)
set ( qtplug_SRCS set ( qtplug_SRCS
qtplug.cpp qtplug.cpp
blankslade.cpp blankslade.cpp
#glwidget.cpp glwidget.cpp
) )
SET ( qtplug_UI SET ( qtplug_UI
@ -30,6 +30,8 @@ if(QT4_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND)
QT4_WRAP_UI(qtplug_UI_h ${qtplug_UI}) QT4_WRAP_UI(qtplug_UI_h ${qtplug_UI})
qt4_automoc(${qtplug_SRCS}) qt4_automoc(${qtplug_SRCS})
DFHACK_PLUGIN(qtplug ${qtplug_SRCS} ${qtplug_RC_SRCS} ${qtplug_UI_h}) DFHACK_PLUGIN(qtplug ${qtplug_SRCS} ${qtplug_RC_SRCS} ${qtplug_UI_h})
# a small texture file
install(FILES terrain.png DESTINATION ${DFHACK_LIBRARY_DESTINATION})
target_link_libraries(qtplug ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ) target_link_libraries(qtplug ${OPENGL_LIBRARIES} ${QT_LIBRARIES} )
ELSE(QT_VERSION_MAJOR MATCHES 4 AND QT_VERSION_MINOR GREATER 6) ELSE(QT_VERSION_MAJOR MATCHES 4 AND QT_VERSION_MINOR GREATER 6)
MESSAGE(STATUS "Can't build the Qt plugin. Your Qt is too old.") MESSAGE(STATUS "Can't build the Qt plugin. Your Qt is too old.")

@ -6,13 +6,13 @@
#include "blankslade.h" #include "blankslade.h"
#include <QFileDialog> #include <QFileDialog>
#include <QDebug> #include <QDebug>
//#include "glwidget.h" #include "glwidget.h"
blankslade::blankslade(QWidget *parent): QMainWindow(parent) blankslade::blankslade(QWidget *parent): QMainWindow(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
//GLWidget * glw = new GLWidget(); GLWidget * glw = new GLWidget();
//ui.gridding->addWidget(glw); ui.gridding->addWidget(glw);
connect(ui.actionOpen,SIGNAL(triggered(bool)),this,SLOT(slotOpen(bool))); connect(ui.actionOpen,SIGNAL(triggered(bool)),this,SLOT(slotOpen(bool)));
connect(ui.actionQuit,SIGNAL(triggered(bool)),this,SLOT(slotQuit(bool))); connect(ui.actionQuit,SIGNAL(triggered(bool)),this,SLOT(slotQuit(bool)));
connect(ui.actionSave,SIGNAL(triggered(bool)),this,SLOT(slotSave(bool))); connect(ui.actionSave,SIGNAL(triggered(bool)),this,SLOT(slotSave(bool)));

@ -9,6 +9,7 @@
#include <QGLShaderProgram> #include <QGLShaderProgram>
#include <QGLPixelBuffer> #include <QGLPixelBuffer>
#include <iostream> #include <iostream>
#include <GL/gl.h>
struct Vertex struct Vertex
{ {
@ -193,7 +194,7 @@ void GLWidget::paintGL()
mvp.rotate(d->rx,0,1,0); mvp.rotate(d->rx,0,1,0);
d->prog.setUniformValue(d->mvpUniform,mvp); d->prog.setUniformValue(d->mvpUniform,mvp);
glActiveTexture(GL_TEXTURE0); //glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, d->terrain); glBindTexture(GL_TEXTURE_2D, d->terrain);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB