1 /** 2 * Copyright: Copyright (C) 2018 Gabriel Gheorghe, All Rights Reserved 3 * Authors: $(Gabriel Gheorghe) 4 * License: $(LINK2 https://www.gnu.org/licenses/gpl-3.0.txt, GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007) 5 * Source: $(LINK2 https://github.com/GabyForceQ/LibertyEngine/blob/master/source/liberty/graphics/video/backend.d, _backend.d) 6 * Documentation: 7 * Coverage: 8 */ 9 // TODO: Window background transparency. 10 module liberty.graphics.video.backend; 11 import liberty.graphics.renderer : Vendor; 12 /// 13 class UnsupportedVideoFeatureException : Exception { 14 /// 15 this(string message, string file = __FILE__, size_t line = __LINE__, Throwable next = null) pure nothrow @safe { 16 super(message, file, line, next); 17 } 18 } 19 /// 20 abstract class VideoBackend { 21 protected { 22 string[] _extensions; 23 int _majorVersion; 24 int _minorVersion; 25 int _maxColorAttachments; 26 } 27 /// 28 bool supportsExtension(string extension) pure nothrow @safe @nogc; 29 /// 30 void reload() @trusted; 31 /// 32 debug void debugCheck() nothrow @trusted; 33 /// 34 void runtimeCheck() @trusted; 35 /// 36 bool runtimeCheckNothrow() nothrow; 37 /// 38 int majorVersion() pure nothrow const @safe @nogc @property; 39 /// 40 int minorVersion() pure nothrow const @safe @nogc @property; 41 /// 42 const(char)[] versionString() @safe @property; 43 /// 44 const(char)[] vendorString() @safe @property; 45 /// 46 Vendor vendor() @safe @property; 47 /// 48 const(char)[] graphicsEngineString() @safe @property; 49 /// 50 const(char)[] glslVersionString() @safe @property; 51 /// 52 string[] extensions() pure nothrow @safe @nogc @property; 53 /// 54 int maxColorAttachments() pure nothrow const @safe @nogc @property; 55 /// 56 void activeTexture(int texture_id) @trusted @property; 57 /// 58 void resizeViewport() @trusted; 59 /// 60 void clear() @trusted; 61 /// 62 void clearColor(float r, float g, float b, float a) @trusted; 63 /// 64 void swapBuffers() @trusted; 65 }