10#ifndef VIDEO_COCOA_OGL_H
11#define VIDEO_COCOA_OGL_H
15@class OTTD_OpenGLView;
17class VideoDriver_CocoaOpenGL :
public VideoDriver_Cocoa {
18 CGLContextObj gl_context;
23 std::optional<std::string_view> AllocateContext(
bool allow_software);
28 std::optional<std::string_view>
Start(
const StringList ¶m)
override;
42 std::string_view
GetName()
const override {
return "cocoa-opengl"; }
44 std::string_view
GetInfoString()
const override {
return this->driver_info; }
49 void Paint()
override;
60 std::unique_ptr<Driver>
CreateInstance()
const override {
return std::make_unique<VideoDriver_CocoaOpenGL>(); }
DriverFactoryBase(Driver::Type type, int priority, std::string_view name, std::string_view description)
Construct a new DriverFactory.
std::unique_ptr< Driver > CreateInstance() const override
Create an instance of this driver-class.
bool UsesHardwareAcceleration() const override
Does the driver use hardware acceleration (video-drivers only).
uint8_t * anim_buffer
Animation buffer from OpenGL back-end.
void * GetVideoPointer() override
Get a pointer to the video buffer.
std::string driver_info
Information string about selected driver.
uint8_t * GetAnimBuffer() override
Get a pointer to the animation buffer of the video back-end.
void PopulateSystemSprites() override
Populate all sprites in cache.
void ReleaseVideoPointer() override
Hand video buffer back to the drawing backend.
std::optional< std::string_view > Start(const StringList ¶m) override
Start this driver.
std::string_view GetName() const override
Get the name of this driver.
void Paint() override
Paint the window.
bool HasEfficient8Bpp() const override
Has this video driver an efficient code path for palette animated 8-bpp sprites?
NSView * AllocateDrawView() override
Allocate the view to show the game on.
std::string_view GetInfoString() const override
Get some information about the selected driver/backend to be shown to the user.
bool HasAnimBuffer() override
Does this video driver support a separate animation buffer in addition to the colour buffer?
void ClearSystemSprites() override
Clear all cached sprites.
void Stop() override
Stop Cocoa video driver.
void AllocateBackingStore(bool force=false) override
Resize the window.
bool UseSystemCursor() override
Get whether the mouse cursor is drawn by the video driver.
std::vector< std::string > StringList
Type for a list of strings.