-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #672 from b-editor/develop
v1.0.0 Preview.1
- Loading branch information
Showing
61 changed files
with
1,856 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace Beutl.Rendering.GlContexts; | ||
|
||
internal enum CGLError | ||
{ | ||
kCGLNoError = 0, | ||
kCGLBadAttribute = 10000, | ||
kCGLBadProperty = 10001, | ||
kCGLBadPixelFormat = 10002, | ||
kCGLBadRendererInfo = 10003, | ||
kCGLBadContext = 10004, | ||
kCGLBadDrawable = 10005, | ||
kCGLBadDisplay = 10006, | ||
kCGLBadState = 10007, | ||
kCGLBadValue = 10008, | ||
kCGLBadMatch = 10009, | ||
kCGLBadEnumeration = 10010, | ||
kCGLBadOffScreen = 10011, | ||
kCGLBadFullScreen = 10012, | ||
kCGLBadWindow = 10013, | ||
kCGLBadAddress = 10014, | ||
kCGLBadCodeModule = 10015, | ||
kCGLBadAlloc = 10016, | ||
kCGLBadConnection = 10017, | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Beutl.Engine/Rendering/GlContexts/Cgl/CGLOpenGLProfile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Beutl.Rendering.GlContexts; | ||
|
||
internal enum CGLOpenGLProfile | ||
{ | ||
kCGLOGLPVersion_Legacy = 0x1000, | ||
kCGLOGLPVersion_3_2_Core = 0x3200, | ||
kCGLOGLPVersion_GL3_Core = 0x3200, | ||
kCGLOGLPVersion_GL4_Core = 0x4100, | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Beutl.Engine/Rendering/GlContexts/Cgl/CGLPixelFormatAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Beutl.Rendering.GlContexts; | ||
|
||
internal enum CGLPixelFormatAttribute | ||
{ | ||
kCGLPFANone = 0, | ||
kCGLPFAAllRenderers = 1, | ||
kCGLPFATripleBuffer = 3, | ||
kCGLPFADoubleBuffer = 5, | ||
kCGLPFAColorSize = 8, | ||
kCGLPFAAlphaSize = 11, | ||
kCGLPFADepthSize = 12, | ||
kCGLPFAStencilSize = 13, | ||
kCGLPFAMinimumPolicy = 51, | ||
kCGLPFAMaximumPolicy = 52, | ||
kCGLPFASampleBuffers = 55, | ||
kCGLPFASamples = 56, | ||
kCGLPFAColorFloat = 58, | ||
kCGLPFAMultisample = 59, | ||
kCGLPFASupersample = 60, | ||
kCGLPFASampleAlpha = 61, | ||
kCGLPFARendererID = 70, | ||
kCGLPFANoRecovery = 72, | ||
kCGLPFAAccelerated = 73, | ||
kCGLPFAClosestPolicy = 74, | ||
kCGLPFABackingStore = 76, | ||
kCGLPFABackingVolatile = 77, | ||
kCGLPFADisplayMask = 84, | ||
kCGLPFAAllowOfflineRenderers = 96, | ||
kCGLPFAAcceleratedCompute = 97, | ||
kCGLPFAOpenGLProfile = 99, | ||
kCGLPFASupportsAutomaticGraphicsSwitching = 101, | ||
kCGLPFAVirtualScreenCount = 128, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Runtime.InteropServices; | ||
|
||
#pragma warning disable SYSLIB1054 | ||
#pragma warning disable IDE1006 | ||
|
||
namespace Beutl.Rendering.GlContexts; | ||
|
||
internal class Cgl | ||
{ | ||
private const string libGL = "/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL"; | ||
|
||
public const int GL_TEXTURE_2D = 0x0DE1; | ||
public const int GL_UNSIGNED_BYTE = 0x1401; | ||
public const int GL_RGBA = 0x1908; | ||
public const int GL_RGBA8 = 0x8058; | ||
|
||
[DllImport(libGL)] | ||
public static extern void CGLGetVersion(out int majorvers, out int minorvers); | ||
|
||
[DllImport(libGL)] | ||
public static extern CGLError CGLChoosePixelFormat([In] CGLPixelFormatAttribute[] attribs, out IntPtr pix, out int npix); | ||
|
||
[DllImport(libGL)] | ||
public static extern CGLError CGLCreateContext(IntPtr pix, IntPtr share, out IntPtr ctx); | ||
|
||
[DllImport(libGL)] | ||
public static extern CGLError CGLReleasePixelFormat(IntPtr pix); | ||
|
||
[DllImport(libGL)] | ||
public static extern CGLError CGLSetCurrentContext(IntPtr ctx); | ||
|
||
[DllImport(libGL)] | ||
public static extern void CGLReleaseContext(IntPtr ctx); | ||
|
||
[DllImport(libGL)] | ||
public static extern CGLError CGLFlushDrawable(IntPtr ctx); | ||
|
||
[DllImport(libGL)] | ||
public static extern void glGenTextures(int n, uint[] textures); | ||
|
||
[DllImport(libGL)] | ||
public static extern void glDeleteTextures(int n, uint[] textures); | ||
|
||
[DllImport(libGL)] | ||
public static extern void glBindTexture(uint target, uint texture); | ||
|
||
[DllImport(libGL)] | ||
public static extern void glTexImage2D(uint target, int level, int internalformat, int width, int height, int border, uint format, uint type, IntPtr pixels); | ||
} |
Oops, something went wrong.