Merge branch 'master' into vulkan

This commit is contained in:
Jérôme Leclercq
2018-02-13 13:06:01 +01:00
425 changed files with 1939 additions and 619 deletions

View 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

View 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