mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
INtroducing the GPUObject for INputFOrmat for GLBackend
This commit is contained in:
parent
2618741505
commit
a31c76f4e1
2 changed files with 62 additions and 0 deletions
33
libraries/gpu-gl/src/gpu/gl/GLInputFormat.cpp
Normal file
33
libraries/gpu-gl/src/gpu/gl/GLInputFormat.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// Created by Sam Gateau on 2016/07/21
|
||||
// Copyright 2013-2016 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
|
||||
//
|
||||
|
||||
#include "GLInputFormat.h"
|
||||
#include "GLBackend.h"
|
||||
|
||||
using namespace gpu;
|
||||
using namespace gpu::gl;
|
||||
|
||||
|
||||
GLInputFormat::GLInputFormat() {
|
||||
}
|
||||
|
||||
GLInputFormat:: ~GLInputFormat() {
|
||||
|
||||
}
|
||||
|
||||
GLInputFormat* GLInputFormat::sync(const Stream::Format& inputFormat) {
|
||||
GLInputFormat* object = Backend::getGPUObject<GLInputFormat>(inputFormat);
|
||||
|
||||
if (!object) {
|
||||
object = new GLInputFormat();
|
||||
object->key = inputFormat.getKey();
|
||||
Backend::setGPUObject(inputFormat, object);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
29
libraries/gpu-gl/src/gpu/gl/GLInputFormat.h
Normal file
29
libraries/gpu-gl/src/gpu/gl/GLInputFormat.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Created by Sam Gateau on 2016/07/21
|
||||
// Copyright 2013-2016 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
|
||||
//
|
||||
#ifndef hifi_gpu_gl_GLInputFormat_h
|
||||
#define hifi_gpu_gl_GLInputFormat_h
|
||||
|
||||
#include "GLShared.h"
|
||||
|
||||
namespace gpu {
|
||||
namespace gl {
|
||||
|
||||
class GLInputFormat : public GPUObject {
|
||||
public:
|
||||
static GLInputFormat* sync(const Stream::Format& inputFormat);
|
||||
|
||||
GLInputFormat();
|
||||
~GLInputFormat();
|
||||
|
||||
std::string key;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue