EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebugLogAnalyzer", "Samples\DebugLogAnalyzer\DebugLogAnalyzer.csproj", "{7915538F-B2B1-414C-95A3-1FC58E3286B9}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EglBackend", "Samples\EglBackend\EglBackend.csproj", "{B815F4D2-D2C4-4914-AE18-676DA05C66B2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{7915538F-B2B1-414C-95A3-1FC58E3286B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7915538F-B2B1-414C-95A3-1FC58E3286B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7915538F-B2B1-414C-95A3-1FC58E3286B9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B815F4D2-D2C4-4914-AE18-676DA05C66B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B815F4D2-D2C4-4914-AE18-676DA05C66B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B815F4D2-D2C4-4914-AE18-676DA05C66B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B815F4D2-D2C4-4914-AE18-676DA05C66B2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
{7AEB6DD5-916E-4415-84E1-78EC6E5881CE} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
{18EBB41F-815E-4BF5-B80F-C9E2FAB2993A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
{7915538F-B2B1-414C-95A3-1FC58E3286B9} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+ {B815F4D2-D2C4-4914-AE18-676DA05C66B2} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {00D4E149-7131-49F4-BAAD-559AA961A78E}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project Sdk="Microsoft.NET.Sdk">
+ <ItemGroup>
+ <EmbeddedResource Include="ui\**\*.*">
+ <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+using System.Threading;
+using Crow;
+using Glfw;
+
+namespace EglBackend
+{
+
+ class MainClass : Interface
+ {
+ const int OpenglEsApi = 0x00030002;
+ const int EglContextApi = 0x00036002;
+ Crow.Cairo.EGLDevice dev;
+
+ MainClass (IntPtr hWnd) : base (800, 600, hWnd) {
+ IntPtr eglDisp = Glfw3.GetEGLDisplay ();
+ IntPtr eglCtx = Glfw3.GetEGLContext (hWnd);
+
+ dev = new Crow.Cairo.EGLDevice (eglDisp, eglCtx);
+ Console.WriteLine ($"Egl device creation status: {dev.Status}");
+ surf = new Crow.Cairo.GLSurface (dev, Glfw3.GetEGLSurface (hWnd), this.clientRectangle.Width, this.clientRectangle.Height);
+ Console.WriteLine ($"Cairo surface creation status: {surf.Status}");
+ Glfw3.MakeContextCurrent (hWnd);
+ Glfw3.SwapInterval (1);
+
+ using (Crow.Cairo.Context ctx = new Crow.Cairo.Context (surf)) {
+ ctx.SetSourceRGB (1, 0, 0);
+ ctx.Paint ();
+ }
+
+ /*Thread t = new Thread (InterfaceThread) {
+ IsBackground = true
+ };
+ t.Start ();*/
+
+ }
+ protected override void Dispose (bool disposing)
+ {
+ surf.Dispose ();
+ dev.Dispose ();
+
+ base.Dispose (disposing);
+ }
+
+ public static void Main (string [] args)
+ {
+ Glfw3.Init ();
+ Glfw3.SetErrorCallback ((error, description) => Console.WriteLine ($"{error}:{description}"));
+ Glfw3.WindowHint (WindowAttribute.ClientApi, OpenglEsApi);
+ Glfw3.WindowHint (WindowAttribute.ContextVersionMajor, 2);
+ Glfw3.WindowHint (WindowAttribute.ContextCreationApi, EglContextApi);
+
+ /*Glfw3.WindowHint (WindowAttribute.RedBits, 8);
+ Glfw3.WindowHint (WindowAttribute.GreenBits, 8);
+ Glfw3.WindowHint (WindowAttribute.BlueBits, 8);
+ Glfw3.WindowHint (WindowAttribute.DepthBits, 8);*/
+
+
+ IntPtr hWnd = Glfw3.CreateWindow (800, 600, "Egl Test", MonitorHandle.Zero, IntPtr.Zero);
+
+ if (hWnd == IntPtr.Zero)
+ throw new Exception ("[GLFW3] Unable to create egl Window");
+
+ Glfw3.MakeContextCurrent (hWnd);
+
+ using (MainClass app = new MainClass (hWnd)) {
+ app.Init ();
+ while(!Glfw3.WindowShouldClose(hWnd)) {
+ app.Update ();
+ if (app.IsDirty) {
+ (app.surf as Crow.Cairo.GLSurface).SwapBuffers ();
+ //Glfw3.SwapBuffers (hWnd);
+ app.IsDirty = false;
+ }
+ Glfw3.PollEvents ();
+ }
+ }
+
+
+ Glfw3.DestroyWindow (hWnd);
+ Glfw3.Terminate ();
+ }
+
+ protected override void OnInitialized ()
+ {
+ base.OnInitialized ();
+ registerGlfwCallbacks ();
+ foreach (string s in System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceNames ()) {
+ Console.WriteLine (s);
+ }
+
+ Load ("#ui.helloworld.crow").DataSource = this;
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<Window Caption="Showcase" Height="90%" Width="90%" Background="Jet">
+ <HorizontalStack>
+ <VerticalStack Width="30%" Margin="5">
+ <GroupBox Caption="Performance" Height="Fit">
+ <VerticalStack DataSource="{updateMeasure}" Width="90%" Height="Fit" Spacing="2">
+ <HorizontalStack Style="HStackMeasure">
+ <Label Text="Cur:" Style="FpsLabel"/>
+ <Label Text="{current}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Style="HStackMeasure">
+ <Label Text="Min:" Style="FpsLabel"/>
+ <Label Text="{minimum}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Style="HStackMeasure">
+ <Label Text="Mean:" Style="FpsLabel"/>
+ <Label Text="{mean}" Style="FpsDisp"/>
+ </HorizontalStack>
+ <HorizontalStack Style="HStackMeasure">
+ <Label Text="Max:" Style="FpsLabel"/>
+ <Label Text="{maximum}" Style="FpsDisp"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </GroupBox>
+ <Label Width="Stretched" Margin="3" Background="DimGrey" />
+ <TextBox Text="TextBox" Multiline="true" Margin="3" />
+ <HorizontalStack Height="Fit" Margin="5" Background="DimGrey" CornerRadius="10">
+ <VerticalStack Spacing="5" Width="50%">
+ <CheckBox Fit="true" Caption="test" />
+ <CheckBox Fit="true" />
+ <CheckBox Fit="true" />
+ <CheckBox Fit="true" IsChecked="true" />
+ </VerticalStack>
+ <VerticalStack Spacing="5" Width="50%">
+ <RadioButton Fit="true" />
+ <RadioButton Fit="true" IsChecked="true" />
+ <RadioButton Fit="true" />
+ <RadioButton Fit="true" />
+ </VerticalStack>
+ </HorizontalStack>
+ <HorizontalStack Height="Fit" Margin="5">
+ <Label Text="MouseEvents" Width="50%" Margin="3" Focusable="true" Background="Jet" Foreground="DimGrey" TextAlignment="Center" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=DimGrey}" MouseDown="{Background=DarkRed}" MouseClick="{Foreground=Green}" MouseDoubleClick="{Foreground=Yellow}" MouseUp="{Background=Jet}" />
+ <Label Text="MouseEvents" Width="50%" Margin="3" Background="Jet" Foreground="DimGrey" TextAlignment="Center" MouseClick="{Foreground=Green}" MouseDoubleClick="{Foreground=Yellow}" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=DimGrey}" MouseDown="{Background=SeaGreen}" MouseUp="{Background=DimGrey}" />
+ </HorizontalStack>
+ <GroupBox Caption="Templated controls" Height="Fit" Margin="5">
+ <HorizontalStack Height="Fit">
+ <VerticalStack Width="50%">
+ <CheckBox Style="CheckBox2" IsChecked="true" />
+ <CheckBox Style="CheckBox2" />
+ <CheckBox Style="CheckBox2" />
+ <CheckBox Style="CheckBox2" />
+ </VerticalStack>
+ <Splitter />
+ <VerticalStack Width="50%">
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
+ </VerticalStack>
+ </HorizontalStack>
+ </GroupBox>
+ <HorizontalStack Height="Fit">
+ <Label Text="Spinner" />
+ <Spinner Fit="true" />
+ </HorizontalStack>
+ <HorizontalStack Height="Fit">
+ <Button Caption="Button">
+ <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}" />
+ </Button>
+ <Button Caption="Button" IsEnabled="false">
+ <Label Font="{./Font}" Name="caption" Margin="3" Foreground="LightGrey" Text="{./Caption}" />
+ </Button>
+ </HorizontalStack>
+ </VerticalStack>
+ <Splitter />
+ <VerticalStack Width="40%" Margin="5" Spacing="5">
+ <Expandable>
+ <Image Path="#Crow.Icons.crow.svg" />
+ </Expandable>
+ <Popper >
+ <Image Path="#Crow.Icons.crow.svg" Background="White" Height="100" Width="100" Margin="20" />
+ </Popper>
+ <Slider Height="10" Width="90%" />
+ <Container Height="Fit" Width="200" Background="DimGrey" Margin="2" CornerRadius="5">
+ <ProgressBar Background="DimGrey" Height="10" Value="50" />
+ </Container>
+ <Image Path="#Crow.Icons.crow.svg" Width="60" Height="60" Background="LightGrey" />
+ <MessageBox Movable="false" />
+ <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Margin="5" />
+ <Widget Name="go" Width="100" Height="60" Background="{../../colorList.SelectedItem}" />
+ <Label Text="{../colorPicker.CurrentColor}" />
+ </VerticalStack>
+ <Splitter />
+ <VerticalStack Width="30%" Margin="5">
+ <ListBox Name="colorList" Data="{TestList}" Margin="5" ItemTemplate="Interfaces/colorItem.crow" />
+ </VerticalStack>
+ </HorizontalStack>
+</Window>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!--<Group>-->
-<Window Name="window1" Left="10" Top="10" Title="Test window"
- Width="250" Height="300" >
- <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">
- <Slider Name="slider" Height="10" Width="0"/>
-
- <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">
- <Checkbox Height="-1" Width="80"/>
- <GraphicObject Width="0"/>
- <Checkbox Height="-1" Width="80"/>
- </HorizontalStack>
- <Groupbox Text="test" Height="-1" Width="-1" Margin="5">
- <VerticalStack Height="-1" Width="0" >
- <RadioButton Caption="Radio 1" Background="Red" />
- <RadioButton Caption="Radio 2" IsChecked="true" />
- <RadioButton Caption="Radio 3" />
- </VerticalStack>
- </Groupbox>
-<!-- <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->
- </VerticalStack>
-</Window>
-<!--</Group>-->
-<!-- <Label Text="{fps}" Background="DarkRed"/>
- <Label Text="{fpsMin}" />
- <Label Text="{fpsMax}" />-->
\ No newline at end of file