Cogs.Core
GraphicsDeviceGLES30.h
1#pragma once
2
3#include "../IGraphicsDevice.h"
4#include "../BaseGL/GLContext.h"
5
6#include "CommonGLES30.h"
7
8#include "BuffersGLES30.h"
9#include "ContextGLES30.h"
10#include "TexturesGLES30.h"
11#include "EffectsGLES30.h"
12#include "RenderTargetsGLES30.h"
13#include "CapabilitiesGLES30.h"
14#include "../BaseGL/SyncObjects.h"
15
16
17namespace Cogs
18{
20 {
23
24 bool initialize();
25
26 std::string getIdentifier() const override { return "OpenGLES30"; }
28
29 void setSize(int width, int height) override;
30 bool getSize(int& w, int& h) const override { w = width; h = height; return true; }
31 void beginFrame() override;
32 void endFrame(uint32_t syncInterval = 0, uint32_t presentFlags = PresentFlags::None) override;
33
34 void releaseResources() override;
35
36 IBuffers* getBuffers() override { return (IBuffers*)&buffers; }
37 ITextures* getTextures() override { return (ITextures*)&textures; }
38 IContext* getImmediateContext() override { return (IContext*)&context; }
39 IEffects* getEffects() override { return (IEffects*)&effects; }
40 IPipelineStates* getPipelineStates() override { return nullptr; }
41 IRenderTargets* getRenderTargets() override { return (IRenderTargets*)&renderTargets; }
42 ICapabilities* getCapabilities() override { return &capabilities; }
43 ISyncObjects* getSyncObjects() override { return &syncObjects; }
44 ISwapChain* getDefaultSwapChain() override { return nullptr; }
45
46 void waitForCommandSync() override {};
47
48 void* getNativeDevice() override { return nullptr; }
49
50 ResourceStatistics getResourceStatistics() override;
51
52 private:
53 ContextGLES30 context;
54 BuffersGLES30 buffers;
55 TexturesGLES30 textures;
56 EffectsGLES30 effects;
57 RenderTargetsGLES30 renderTargets;
58 CapabilitiesGLES30 capabilities;
59 GLSyncObjects syncObjects;
60 GLContext glContext;
61 int width = 1;
62 int height = 1;
63 };
64}
Represents a graphics device used to manage graphics resources and issue drawing commands.
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
GraphicsDeviceType
Contains types of graphics devices that may be supported.
Definition: Base.h:48
@ OpenGLES30
Graphics device using the OpenGLES 3.0 API.
bool initialize()
Initializes the graphics device with the settings previous set through calling setSettings.
IEffects * getEffects() override
Get a pointer to the effect management interface.
GraphicsDeviceType getType() const override
Get the type of the graphics device.
ISwapChain * getDefaultSwapChain() override
Get a pointer to the default swap chain for this graphics device.
std::string getIdentifier() const override
Get the graphics device identifier.
ICapabilities * getCapabilities() override
Get a pointer to the capability management interface used to query the graphics device capability fla...
void setSize(int width, int height) override
Set the size of the main drawing buffer used by the graphics device in pixels.
IPipelineStates * getPipelineStates() override
Get a pointer to the pipeline state management interface.
IBuffers * getBuffers() override
Get a pointer to the buffer management interface.
IRenderTargets * getRenderTargets() override
Get a pointer to the render target management interface.
void releaseResources() override
Release all resources allocated.
void waitForCommandSync() override
Wait for any GPU commands on the current device to finish before returning.
bool getSize(int &w, int &h) const override
Retrieve the size previously set by setSize.
ITextures * getTextures() override
Get a pointer to the texture management interface.
IContext * getImmediateContext() override
Get a pointer to the immediate context used to issue commands to the graphics device.
void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None) override
Signal the end of a frame to the graphics device.
ISyncObjects * getSyncObjects() override
Get a pointer to the sync object management interface.
void beginFrame() override
Signal the beginning of a new frame to the graphics device.
Provides buffer management functionality.
Definition: IBuffers.h:13
Provides capability query functionality.
Represents a graphics device context which can receive rendering commands.
Definition: IContext.h:43
Provides effects and shader management functionality.
Definition: IEffects.h:148
Provides render target management functionality.
Provides sync object management.
Definition: ISyncObjects.h:14
Provides texture management functionality.
Definition: ITextures.h:40
@ None
No flags.
Definition: Common.h:177
Allocation information.
Definition: Base.h:35