Adding missing files

This commit is contained in:
Brad Davis 2015-05-29 12:59:55 -07:00
parent f98305dd55
commit 77b45e2b4a
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,16 @@
#include "GLHelpers.h"
QSurfaceFormat getDefaultOpenGlSurfaceFormat() {
QSurfaceFormat format;
// Qt Quick may need a depth and stencil buffer. Always make sure these are available.
format.setDepthBufferSize(DEFAULT_GL_DEPTH_BUFFER_BITS);
format.setStencilBufferSize(DEFAULT_GL_STENCIL_BUFFER_BITS);
format.setVersion(4, 1);
#ifdef DEBUG
format.setOption(QSurfaceFormat::DebugContext);
#endif
// FIXME move to core as soon as possible
format.setProfile(QSurfaceFormat::OpenGLContextProfile::CompatibilityProfile);
return format;
}

View file

@ -0,0 +1,23 @@
//
// Created by Bradley Austin Davis 2015/05/29
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#pragma once
#ifndef hifi_GLHelpers_h
#define hifi_GLHelpers_h
#include <QSurfaceFormat>
// 16 bits of depth precision
#define DEFAULT_GL_DEPTH_BUFFER_BITS 16
// 8 bits of stencil buffer (typically you really only need 1 bit for functionality
// but GL implementations usually just come with buffer sizes in multiples of 8)
#define DEFAULT_GL_STENCIL_BUFFER_BITS 8
QSurfaceFormat getDefaultOpenGlSurfaceFormat();
#endif