Start preview feature. Add dummy triangle to test OpenGL.
This commit is contained in:
		
							
								
								
									
										43
									
								
								resources/preview-window.glade
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								resources/preview-window.glade
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!-- Generated with glade 3.38.2 -->
 | 
			
		||||
<interface>
 | 
			
		||||
  <requires lib="gtk+" version="3.24"/>
 | 
			
		||||
  <object class="GtkWindow" id="main-window">
 | 
			
		||||
    <property name="can-focus">False</property>
 | 
			
		||||
    <property name="default-width">1024</property>
 | 
			
		||||
    <property name="default-height">500</property>
 | 
			
		||||
    <child>
 | 
			
		||||
      <object class="GtkBox">
 | 
			
		||||
        <property name="visible">True</property>
 | 
			
		||||
        <property name="can-focus">False</property>
 | 
			
		||||
        <property name="baseline-position">bottom</property>
 | 
			
		||||
        <child>
 | 
			
		||||
          <object class="GtkButton">
 | 
			
		||||
            <property name="label" translatable="yes">button</property>
 | 
			
		||||
            <property name="visible">True</property>
 | 
			
		||||
            <property name="can-focus">True</property>
 | 
			
		||||
            <property name="receives-default">True</property>
 | 
			
		||||
          </object>
 | 
			
		||||
          <packing>
 | 
			
		||||
            <property name="expand">False</property>
 | 
			
		||||
            <property name="fill">True</property>
 | 
			
		||||
            <property name="position">0</property>
 | 
			
		||||
          </packing>
 | 
			
		||||
        </child>
 | 
			
		||||
        <child>
 | 
			
		||||
          <object class="GtkGLArea" id="gl-area">
 | 
			
		||||
            <property name="visible">True</property>
 | 
			
		||||
            <property name="app-paintable">True</property>
 | 
			
		||||
            <property name="can-focus">False</property>
 | 
			
		||||
            <property name="has-alpha">True</property>
 | 
			
		||||
          </object>
 | 
			
		||||
          <packing>
 | 
			
		||||
            <property name="expand">True</property>
 | 
			
		||||
            <property name="fill">True</property>
 | 
			
		||||
            <property name="position">1</property>
 | 
			
		||||
          </packing>
 | 
			
		||||
        </child>
 | 
			
		||||
      </object>
 | 
			
		||||
    </child>
 | 
			
		||||
  </object>
 | 
			
		||||
</interface>
 | 
			
		||||
@@ -5,6 +5,7 @@
 | 
			
		||||
		<file compressed="true">about.glade</file>
 | 
			
		||||
		<file>layer-widget.glade</file>
 | 
			
		||||
		<file>dialog.glade</file>
 | 
			
		||||
		<file compressed="true">preview-window.glade</file>
 | 
			
		||||
	</gresource>
 | 
			
		||||
	<gresource prefix="/data">
 | 
			
		||||
		<file compressed="true">color-palette.txt</file>
 | 
			
		||||
@@ -12,6 +13,10 @@
 | 
			
		||||
	<gresource prefix="/images">
 | 
			
		||||
		<file compressed="true" alias="logo.svg">../icon/gds-render.svg</file>
 | 
			
		||||
	</gresource>
 | 
			
		||||
	<gresource prefix="/shaders">
 | 
			
		||||
		<file compressed="true" alias="polygon.fs">./shaders/polygon.fs.glsl</file>
 | 
			
		||||
		<file compressed="true" alias="polygon.vs">./shaders/polygon.vs.glsl</file>
 | 
			
		||||
	</gresource>
 | 
			
		||||
</gresources>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								resources/shaders/polygon.fs.glsl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								resources/shaders/polygon.fs.glsl
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
#version 330 core
 | 
			
		||||
 | 
			
		||||
out vec4 FragColor;
 | 
			
		||||
in  vec4 vertex_color;
 | 
			
		||||
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
	FragColor = vertex_color;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										12
									
								
								resources/shaders/polygon.vs.glsl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								resources/shaders/polygon.vs.glsl
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
#version 330 core
 | 
			
		||||
 | 
			
		||||
//uniform mat4 mvp;
 | 
			
		||||
uniform vec4 const_color;
 | 
			
		||||
 | 
			
		||||
layout (location = 0) in vec2 input_vertex;
 | 
			
		||||
out vec4 vertex_color;
 | 
			
		||||
void main()
 | 
			
		||||
{
 | 
			
		||||
	gl_Position = vec4(input_vertex.x, input_vertex.y, 0.0, 1.0);
 | 
			
		||||
	vertex_color = const_color;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user