mirror of https://github.com/mosra/magnum.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.8 KiB
80 lines
2.8 KiB
|
14 years ago
|
/*
|
||
|
|
This file is part of Magnum.
|
||
|
|
|
||
|
13 years ago
|
Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš <mosra@centrum.cz>
|
||
|
|
|
||
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
|
copy of this software and associated documentation files (the "Software"),
|
||
|
|
to deal in the Software without restriction, including without limitation
|
||
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
||
|
|
Software is furnished to do so, subject to the following conditions:
|
||
|
|
|
||
|
|
The above copyright notice and this permission notice shall be included
|
||
|
|
in all copies or substantial portions of the Software.
|
||
|
|
|
||
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||
|
|
DEALINGS IN THE SOFTWARE.
|
||
|
14 years ago
|
*/
|
||
|
|
|
||
|
|
#include "State.h"
|
||
|
|
|
||
|
13 years ago
|
#include "Context.h"
|
||
|
|
#include "Extensions.h"
|
||
|
13 years ago
|
#include "Implementation/BufferState.h"
|
||
|
13 years ago
|
#include "Implementation/DebugState.h"
|
||
|
13 years ago
|
#include "Implementation/FramebufferState.h"
|
||
|
|
#include "Implementation/MeshState.h"
|
||
|
|
#include "Implementation/RendererState.h"
|
||
|
|
#include "Implementation/ShaderState.h"
|
||
|
|
#include "Implementation/ShaderProgramState.h"
|
||
|
|
#include "Implementation/TextureState.h"
|
||
|
14 years ago
|
|
||
|
14 years ago
|
namespace Magnum { namespace Implementation {
|
||
|
|
|
||
|
13 years ago
|
State::State(Context& context):
|
||
|
14 years ago
|
buffer(new BufferState),
|
||
|
13 years ago
|
debug(new DebugState(context)),
|
||
|
14 years ago
|
framebuffer(new FramebufferState),
|
||
|
|
mesh(new MeshState),
|
||
|
13 years ago
|
renderer(new RendererState),
|
||
|
13 years ago
|
shader(new ShaderState),
|
||
|
14 years ago
|
shaderProgram(new ShaderProgramState),
|
||
|
13 years ago
|
texture(new TextureState)
|
||
|
|
{
|
||
|
13 years ago
|
|
||
|
|
Debug() << "Using optional features:";
|
||
|
|
|
||
|
|
if(context.isExtensionSupported<Extensions::GL::KHR::debug>())
|
||
|
|
Debug() << " " << Extensions::GL::KHR::debug::string();
|
||
|
13 years ago
|
else {
|
||
|
|
if(context.isExtensionSupported<Extensions::GL::EXT::debug_label>())
|
||
|
|
Debug() << " " << Extensions::GL::EXT::debug_label::string();
|
||
|
|
|
||
|
|
if(context.isExtensionSupported<Extensions::GL::EXT::debug_marker>())
|
||
|
|
Debug() << " " << Extensions::GL::EXT::debug_marker::string();
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
|
else if(context.isExtensionSupported<Extensions::GL::GREMEDY::string_marker>())
|
||
|
|
Debug() << " " << Extensions::GL::GREMEDY::string_marker::string();
|
||
|
|
#endif
|
||
|
|
}
|
||
|
13 years ago
|
}
|
||
|
14 years ago
|
|
||
|
|
State::~State() {
|
||
|
14 years ago
|
delete texture;
|
||
|
14 years ago
|
delete shaderProgram;
|
||
|
13 years ago
|
delete shader;
|
||
|
13 years ago
|
delete renderer;
|
||
|
14 years ago
|
delete mesh;
|
||
|
14 years ago
|
delete framebuffer;
|
||
|
13 years ago
|
delete debug;
|
||
|
14 years ago
|
delete buffer;
|
||
|
14 years ago
|
}
|
||
|
|
|
||
|
|
}}
|