3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 11:55:25 +02:00

Working on OSX functionality

This commit is contained in:
Bradley Austin Davis 2015-04-15 23:00:10 -07:00
parent aba2b395a6
commit f700607a65
6 changed files with 20 additions and 12 deletions
interface
libraries/render-utils/src
tests/render-utils/src

View file

@ -11,7 +11,6 @@ Item {
id: dialog
width: 256
height: 256
property rect clientArea: clientBorder
property int topMargin: dialog.height - clientBorder.height + 8
property int margins: 8
property string title

View file

@ -650,6 +650,7 @@ Application::~Application() {
// stop the glWidget frame timer so it doesn't call paintGL
_glWidget->stopFrameTimer();
DependencyManager::destroy<OffscreenUi>();
DependencyManager::destroy<AvatarManager>();
DependencyManager::destroy<AnimationCache>();
DependencyManager::destroy<TextureCache>();

View file

@ -17,6 +17,7 @@
#include <QQueue>
#include <QMap>
#include <QSharedPointer>
#include <QMutex>
class QOpenGLFramebufferObject;

View file

@ -16,16 +16,18 @@ OffscreenGlCanvas::OffscreenGlCanvas() {
}
void OffscreenGlCanvas::create(QOpenGLContext * sharedContext) {
QSurfaceFormat format;
format.setDepthBufferSize(16);
format.setStencilBufferSize(8);
format.setMajorVersion(4);
format.setMinorVersion(1);
format.setProfile(QSurfaceFormat::OpenGLContextProfile::CompatibilityProfile);
_context.setFormat(format);
if (nullptr != sharedContext) {
sharedContext->doneCurrent();
_context.setFormat(sharedContext->format());
_context.setShareContext(sharedContext);
} else {
QSurfaceFormat format;
format.setDepthBufferSize(16);
format.setStencilBufferSize(8);
format.setMajorVersion(4);
format.setMinorVersion(1);
format.setProfile(QSurfaceFormat::OpenGLContextProfile::CompatibilityProfile);
_context.setFormat(format);
}
_context.create();

View file

@ -44,7 +44,7 @@ public: \
private:
#define QML_DIALOG_DEF(x) \
const QUrl x::QML = #x ".qml"; \
const QUrl x::QML = QUrl(#x ".qml"); \
const QString x::NAME = #x; \
\
void x::registerType() { \

View file

@ -31,6 +31,7 @@
#include <memory>
#include <glm/glm.hpp>
#include <PathUtils.h>
#include <QDir>
class RateCounter {
std::vector<float> times;
@ -159,8 +160,12 @@ public:
// "#0e7077"
setFramePosition(QPoint(-1000, 0));
resize(QSize(800, 600));
static const QString f("/Users/bdavis/Git/hifi/interface/resources/qml/TestRoot.qml");
QApplication::applicationDirPath();
QDir path(__FILE__);
path.cdUp();
static const QString f(path.cleanPath(path.absoluteFilePath("../../../interface/resources/qml/TestRoot.qml")));
_offscreenUi.loadQml(QUrl::fromLocalFile(f));
connect(&_offscreenUi, &OffscreenUi::textureUpdated, this, [&](int textureId) {
_offscreenUi.lockTexture(textureId);