Merge branch 'master' into vulkan
This commit is contained in:
44
src/Nazara/Renderer/HardwareBuffer.hpp
Normal file
44
src/Nazara/Renderer/HardwareBuffer.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_HARDWAREBUFFER_HPP
|
||||
#define NAZARA_HARDWAREBUFFER_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Renderer/OpenGL.hpp>
|
||||
#include <Nazara/Utility/AbstractBuffer.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class Buffer;
|
||||
|
||||
class HardwareBuffer : public AbstractBuffer
|
||||
{
|
||||
public:
|
||||
HardwareBuffer(Buffer* parent, BufferType type);
|
||||
~HardwareBuffer();
|
||||
|
||||
bool Fill(const void* data, UInt32 offset, UInt32 size) override;
|
||||
|
||||
bool Initialize(unsigned int size, BufferUsageFlags usage) override;
|
||||
|
||||
DataStorage GetStorage() const override;
|
||||
|
||||
void* Map(BufferAccess access, UInt32 offset = 0, UInt32 size = 0) override;
|
||||
bool Unmap() override;
|
||||
|
||||
// Fonctions OpenGL
|
||||
void Bind() const;
|
||||
GLuint GetOpenGLID() const;
|
||||
|
||||
private:
|
||||
GLuint m_buffer;
|
||||
BufferType m_type;
|
||||
Buffer* m_parent;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_HARDWAREBUFFER_HPP
|
||||
41
src/Nazara/Renderer/Win32/ContextImpl.hpp
Normal file
41
src/Nazara/Renderer/Win32/ContextImpl.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONTEXTIMPL_HPP
|
||||
#define NAZARA_CONTEXTIMPL_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Renderer/ContextParameters.hpp>
|
||||
#include <windows.h>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class ContextImpl
|
||||
{
|
||||
public:
|
||||
ContextImpl();
|
||||
|
||||
bool Activate() const;
|
||||
|
||||
bool Create(ContextParameters& parameters);
|
||||
|
||||
void Destroy();
|
||||
|
||||
void EnableVerticalSync(bool enabled);
|
||||
|
||||
void SwapBuffers();
|
||||
|
||||
static bool Desactivate();
|
||||
|
||||
private:
|
||||
HDC m_deviceContext;
|
||||
HGLRC m_context;
|
||||
HWND m_window;
|
||||
bool m_ownsWindow;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_CONTEXTIMPL_HPP
|
||||
Reference in New Issue
Block a user