Made Context/RenderTarget usage constant

Former-commit-id: 07a2655ea642664bc49ca335cf5147ebf9fb9f26
This commit is contained in:
Lynix
2013-03-02 19:09:13 +01:00
parent 2f85b258e9
commit cd48d70844
10 changed files with 27 additions and 28 deletions

View File

@@ -26,13 +26,13 @@ class NAZARA_API NzContext : public NzResource
const NzContextParameters& GetParameters() const;
bool IsActive() const;
bool SetActive(bool active);
bool SetActive(bool active) const;
void SwapBuffers();
static bool EnsureContext();
static NzContext* GetCurrent();
static const NzContext* GetCurrent();
static const NzContext* GetReference();
static NzContext* GetThreadContext();
static const NzContext* GetThreadContext();
static bool Initialize();
static void Uninitialize();

View File

@@ -34,8 +34,8 @@ class NAZARA_API NzRenderTarget
virtual bool HasContext() const = 0;
protected:
virtual bool Activate() = 0;
virtual void Desactivate();
virtual bool Activate() const = 0;
virtual void Desactivate() const;
};
#endif // NAZARA_RENDERTARGET_HPP

View File

@@ -48,8 +48,8 @@ class NAZARA_API NzRenderTexture : public NzRenderTarget, NzResourceListener, Nz
static bool IsSupported();
protected:
bool Activate() override;
void Desactivate() override;
bool Activate() const override;
void Desactivate() const override;
private:
void OnResourceDestroy(const NzResource* resource, int index) override;

View File

@@ -53,7 +53,7 @@ class NAZARA_API NzRenderWindow : public NzRenderTarget, public NzWindow
bool HasContext() const;
protected:
bool Activate() override;
bool Activate() const override;
private:
bool OnWindowCreated() override;

View File

@@ -55,7 +55,7 @@ class NAZARA_API NzRenderer
static unsigned int GetMaxTextureUnits();
static float GetPointSize();
static const NzShader* GetShader();
static NzRenderTarget* GetTarget();
static const NzRenderTarget* GetTarget();
static NzRectui GetViewport();
static bool HasCapability(nzRendererCap capability);
@@ -84,7 +84,7 @@ class NAZARA_API NzRenderer
static void SetStencilPassOperation(nzStencilOperation passOperation);
static void SetStencilReferenceValue(unsigned int refValue);
static void SetStencilZFailOperation(nzStencilOperation zfailOperation);
static bool SetTarget(NzRenderTarget* target);
static bool SetTarget(const NzRenderTarget* target);
static void SetTexture(nzUInt8 unit, const NzTexture* texture);
static void SetTextureSampler(nzUInt8 textureUnit, const NzTextureSampler& sampler);
static bool SetVertexBuffer(const NzVertexBuffer* vertexBuffer);