mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 22:06:18 +02:00
Adding missing files
This commit is contained in:
parent
f98305dd55
commit
77b45e2b4a
2 changed files with 39 additions and 0 deletions
16
libraries/shared/src/GLHelpers.cpp
Normal file
16
libraries/shared/src/GLHelpers.cpp
Normal 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;
|
||||
}
|
23
libraries/shared/src/GLHelpers.h
Normal file
23
libraries/shared/src/GLHelpers.h
Normal 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
|
Loading…
Reference in a new issue