2019-03-14 15:58:55 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "Macros.h"
|
|
|
|
|
|
|
|
CC_BACKEND_BEGIN
|
|
|
|
|
2019-05-16 09:26:00 +08:00
|
|
|
enum class FeatureType : uint32_t
|
|
|
|
{
|
|
|
|
ETC1,
|
|
|
|
S3TC,
|
|
|
|
AMD_COMPRESSED_ATC,
|
|
|
|
PVRTC,
|
|
|
|
IMG_FORMAT_BGRA8888,
|
|
|
|
DISCARD_FRAMEBUFFER,
|
|
|
|
PACKED_DEPTH_STENCIL,
|
|
|
|
VAO,
|
|
|
|
MAPBUFFER,
|
|
|
|
DEPTH24,
|
|
|
|
ASTC
|
|
|
|
};
|
|
|
|
|
2019-03-15 11:13:40 +08:00
|
|
|
class DeviceInfo
|
2019-03-14 15:58:55 +08:00
|
|
|
{
|
|
|
|
public:
|
2019-03-15 11:13:40 +08:00
|
|
|
virtual ~DeviceInfo() = default;
|
2019-03-14 15:58:55 +08:00
|
|
|
virtual bool init() = 0;
|
2019-05-16 09:26:00 +08:00
|
|
|
virtual const char* getVendor() const = 0;
|
|
|
|
virtual const char* getRenderer() const = 0;
|
|
|
|
virtual const char* getVersion() const = 0;
|
|
|
|
virtual const char* getExtension() const = 0;
|
|
|
|
virtual bool checkForFeatureSupported(FeatureType feature) = 0;
|
|
|
|
|
2019-03-14 15:58:55 +08:00
|
|
|
inline int getMaxTextureSize() const { return _maxTextureSize; }
|
|
|
|
inline int getMaxAttributes() const { return _maxAttributes; }
|
2019-05-16 09:26:00 +08:00
|
|
|
inline int getMaxTextureUnits() const { return _maxTextureUnits; }
|
|
|
|
inline int getMaxSamplesAllowed() const { return _maxSamplesAllowed; }
|
2019-03-14 15:58:55 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
DeviceInfo() = default;
|
|
|
|
|
|
|
|
int _maxAttributes = 0;
|
|
|
|
int _maxTextureSize = 0;
|
2019-05-16 09:26:00 +08:00
|
|
|
int _maxTextureUnits = 0;
|
|
|
|
int _maxSamplesAllowed = 0;
|
2019-03-14 15:58:55 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
CC_BACKEND_END
|