aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Kugis <leonardkugis@gmail.com>2018-01-26 15:34:06 +0100
committerLeonard Kugis <leonardkugis@gmail.com>2018-01-26 15:34:06 +0100
commit3d162bbcc92b22e6b00ee80194214c393770adb7 (patch)
tree70f7ceeebbfab4e85731c7bdc5df17f7b2b9b3dd
parent1c3ea27064257d8cf7b9f36b0388b8cf2e94ab08 (diff)
fixed crash
-rw-r--r--.cproject27
-rw-r--r--.settings/org.eclipse.cdt.managedbuilder.core.prefs10
-rw-r--r--Debug/glade/settings.glade918
-rw-r--r--src/render.c17
-rw-r--r--src/render.h4
-rw-r--r--src/render_cpu.c23
-rw-r--r--src/render_cpu.h2
7 files changed, 961 insertions, 40 deletions
diff --git a/.cproject b/.cproject
index c515ae5..78a622f 100644
--- a/.cproject
+++ b/.cproject
@@ -34,28 +34,7 @@
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1870710598" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.588576008" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.2103695181" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\atk-1.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\cairo&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\fontconfig&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\freetype2&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\gail-3.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\gdk-pixbuf-2.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\gio-win32-2.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\glib-2.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\gtk-3.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\lib\glib-2.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\include\pango-1.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\gtk\lib\glib-2.0\include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MSYS_HOME}\mingw32\include\gtk-3.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include\gdk-pixbuf-2.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include\glib-2.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include\atk-1.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include\pango-1.0&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\lib\glib-2.0\include&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include\cairo&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include\epoxy&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include&quot;"/>
- <listOptionValue builtIn="false" value="&quot;C:\msys64\mingw32\include\gtk-3.0&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MSYS_HOME}\mingw32\include\gdk-pixbuf-2.0&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MSYS_HOME}\mingw32\include\glib-2.0&quot;"/>
<listOptionValue builtIn="false" value="&quot;${MSYS_HOME}\mingw32\include\atk-1.0&quot;"/>
@@ -73,22 +52,20 @@
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="atk-1.0"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="cairo"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="fontconfig"/>
- <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gailutil"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gdk_pixbuf-2.0"/>
- <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gdk-win32-3.0"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gio-2.0"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="glib-2.0"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gmodule-2.0"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gobject-2.0"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gthread-2.0"/>
- <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gtk-win32-3.0"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gtk-3"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gdk-3"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="glut32"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="glut"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="opengl32"/>
- <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="math"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="OpenCL"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="gailutil-3"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="pthread"/>
</option>
<option id="gnu.c.link.option.paths.1322466417" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${MSYS_HOME}\mingw32\lib&quot;"/>
diff --git a/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/.settings/org.eclipse.cdt.managedbuilder.core.prefs
index c78c51c..ce039ab 100644
--- a/.settings/org.eclipse.cdt.managedbuilder.core.prefs
+++ b/.settings/org.eclipse.cdt.managedbuilder.core.prefs
@@ -1,10 +1,20 @@
eclipse.preferences.version=1
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/CPATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/CPATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/C_INCLUDE_PATH/delimiter=;
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/C_INCLUDE_PATH/operation=remove
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/append=true
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/appendContributed=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/CPATH/delimiter=;
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/C_INCLUDE_PATH/delimiter=;
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/appendContributed=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/LIBRARY_PATH/delimiter=;
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/LIBRARY_PATH/operation=remove
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/append=true
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.966253669/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/LIBRARY_PATH/delimiter=;
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.659598002/LIBRARY_PATH/value=C\:\\lib
diff --git a/Debug/glade/settings.glade b/Debug/glade/settings.glade
new file mode 100644
index 0000000..40b0995
--- /dev/null
+++ b/Debug/glade/settings.glade
@@ -0,0 +1,918 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <requires lib="gtk+" version="2.24"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkColorSelectionDialog" id="colorDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="color_selection">
+ <object class="GtkColorSelection" id="colorsel-color_selection1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="current_color">#000000000000</property>
+ <child>
+ <object class="GtkLabel" id="colorStatus">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Select a color</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">colorsel-help_button1</action-widget>
+ <action-widget response="0">colorsel-cancel_button1</action-widget>
+ <action-widget response="0">colorsel-ok_button1</action-widget>
+ </action-widgets>
+ <child internal-child="help_button">
+ <object class="GtkButton" id="colorsel-help_button1">
+ <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>
+ </child>
+ <action-widgets>
+ <action-widget response="0">colorsel-help_button1</action-widget>
+ <action-widget response="0">colorsel-cancel_button1</action-widget>
+ <action-widget response="0">colorsel-ok_button1</action-widget>
+ </action-widgets>
+ <child internal-child="cancel_button">
+ <object class="GtkButton" id="colorsel-cancel_button1">
+ <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>
+ </child>
+ <action-widgets>
+ <action-widget response="0">colorsel-help_button1</action-widget>
+ <action-widget response="0">colorsel-cancel_button1</action-widget>
+ <action-widget response="0">colorsel-ok_button1</action-widget>
+ </action-widgets>
+ <child internal-child="ok_button">
+ <object class="GtkButton" id="colorsel-ok_button1">
+ <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>
+ </child>
+ <action-widgets>
+ <action-widget response="0">colorsel-help_button1</action-widget>
+ <action-widget response="0">colorsel-cancel_button1</action-widget>
+ <action-widget response="0">colorsel-ok_button1</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkWindow" id="settings">
+ <property name="can_focus">False</property>
+ <property name="resizable">False</property>
+ <property name="default_width">300</property>
+ <property name="default_height">300</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkFrame" id="generalFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">6</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="iterationsLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Max. iterations</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="iterationsSp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="colorFromLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">from</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="colorFromBtn">
+ <property name="label" translatable="yes">Select...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="colorToLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">to</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="colorToBtn">
+ <property name="label" translatable="yes">Select...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="colorLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Color (from &lt; to)</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="zoomLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Zoom to (temp)</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="zoomToXLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">X</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="zoomToXEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="zoomToYLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Y</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="zoomToYEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="speedLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Zoom speed</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="speedEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="setLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Set</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="setCombo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="modeLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Render mode</property>
+ </object>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkRadioButton" id="modeCPURd">
+ <property name="label" translatable="yes">CPU</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="modeGPURd">
+ <property name="label" translatable="yes">GPU (OpenCL)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="generalLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">General settings</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkFrame" id="cpuFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_columns">2</property>
+ <child>
+ <object class="GtkLabel" id="threadsLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Threads</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="threadsSp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="cpuLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">CPU</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="gpuFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkAlignment" id="alignment6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">not implemented yet</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="gpuLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">GPU</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="videoFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="exportCb">
+ <property name="label" translatable="yes">Export to file</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="filetypeFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkRadioButton" id="gifRd">
+ <property name="label" translatable="yes">GIF</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="filetypeLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">File type</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">6</property>
+ <property name="n_columns">2</property>
+ <child>
+ <object class="GtkLabel" id="widthLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Render width</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="heightLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Render height</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="fpsRenderLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Render FPS</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="fpsVideoLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Video FPS</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="bitrateLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Video bitrate (kbit/s)</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="widthSp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="heightSp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="fpsRenderSp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="fpsVideoSp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="bitrateSp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="exportLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Export file</property>
+ </object>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="exportTf">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="text" translatable="yes">C:\path\to\file.format</property>
+ <property name="invisible_char_set">True</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="videoLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Video settings</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="controlsFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <child>
+ <object class="GtkLabel" id="inLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Zoom in</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="outLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Zoom out</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="inCombo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="outCombo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="controlsLbl">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Control settings</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="startBtn">
+ <property name="label" translatable="yes">Start</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="exitBtn">
+ <property name="label" translatable="yes">Exit</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/src/render.c b/src/render.c
index 69b46e0..b9ad5e0 100644
--- a/src/render.c
+++ b/src/render.c
@@ -11,24 +11,28 @@
void init_render(Config *config)
{
+ _config = config;
s_arr = (u32 *) malloc((_config->width) * (_config->height) * sizeof(u32));
+ _config->config_cpu.arr = s_arr;
+ _config->config_opencl.arr = s_arr;
//glutInit(0, NULL);
glutInitWindowPosition(0, 0);
glutInitWindowSize(_config->width, _config->height);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("Renderer");
- if (_config->mode)
+ switch(_config->mode)
{
+ case MODE_CPU:
+ init_cpu(&_config->config_cpu);
glutDisplayFunc(render_cpu);
glutIdleFunc(idle_cpu);
- init_cpu(&_config->config_cpu);
- }
- else
- {
+ break;
+ case MODE_OPENCL:
+ init_opencl(&_config->config_opencl);
glutDisplayFunc(render_opencl);
glutIdleFunc(idle_opencl);
- init_opencl(&_config->config_opencl);
+ break;
}
glGenTextures(1, &tex);
@@ -43,6 +47,7 @@ void init_render(Config *config)
glOrtho(0, _config->width, 0, _config->height, -1, 1);
glMatrixMode(GL_MODELVIEW);
glutMainLoop();
+
}
void show_render()
diff --git a/src/render.h b/src/render.h
index 2cb76c1..4ae2360 100644
--- a/src/render.h
+++ b/src/render.h
@@ -8,8 +8,6 @@
#ifndef RENDER_H_
#define RENDER_H_
-#define COORDS(x, y, width) ((y)*(width)+(x))
-
#include "defs.h"
#include "render_cpu.h"
#include "render_opencl.h"
@@ -29,7 +27,7 @@ typedef struct config {
} Config;
Config *_config;
-u32 s_arr;
+u32 *s_arr;
void init_render(Config *config);
void show_render();
diff --git a/src/render_cpu.c b/src/render_cpu.c
index 9370461..f3bf28e 100644
--- a/src/render_cpu.c
+++ b/src/render_cpu.c
@@ -5,12 +5,23 @@
* Author: Superleo1810
*/
-#include "render.h"
+#include "render_cpu.h"
#define HAVE_STRUCT_TIMESPEC
void init_cpu(CpuConfig *config)
{
config_cpu = config;
+ delta = glutGet(GLUT_ELAPSED_TIME);
+ x_min_s = -2.0;
+ x_max_s = 1.0;
+ y_min_s= -1.0;
+ y_max_s = 1.0;
+ x_min = x_min_s;
+ x_max = x_max_s;
+ y_min = y_min_s;
+ y_max = y_max_s;
+
+ calculate(x_min, y_min, x_max, y_max, config_cpu->set_func, config_cpu->arr);
}
void render_cpu(void)
@@ -21,9 +32,9 @@ void render_cpu(void)
glBegin(GL_QUADS);
glTexCoord2i(0, 0); glVertex2i(0, 0);
- glTexCoord2i(0, 1); glVertex2i(0, _config->height);
- glTexCoord2i(1, 1); glVertex2i(_config->width, _config->height);
- glTexCoord2i(1, 0); glVertex2i(_config->width, 0);
+ glTexCoord2i(0, 1); glVertex2i(0, config_cpu->height);
+ glTexCoord2i(1, 1); glVertex2i(config_cpu->width, config_cpu->height);
+ glTexCoord2i(1, 0); glVertex2i(config_cpu->width, 0);
glEnd();
glDisable(GL_TEXTURE_2D);
@@ -50,7 +61,7 @@ void calculate_t(void *args)
u32 iterations;
for (u32 y = (config_cpu->height/_args->tc)*(_args->tid); y < config_cpu->height; y++)
{
- for (u32 x = 0; x < _config->width; x++)
+ for (u32 x = 0; x < config_cpu->width; x++)
{
x_math = _args->x_min + ((d64) x * (_args->x_max - _args->x_min)) / config_cpu->width;
y_math = _args->y_min + ((d64) (config_cpu->height - y) * (_args->y_max - _args->y_min)) / config_cpu->height;
@@ -72,7 +83,7 @@ void idle_cpu(void)
glBindTexture(GL_TEXTURE_2D, tex);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, config_cpu->width, config_cpu->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, s_arr);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, config_cpu->width, config_cpu->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, config_cpu->arr);
glBindTexture(GL_TEXTURE_2D, 0);
int t = glutGet(GLUT_ELAPSED_TIME);
dt = (t - delta) / 1000.0;
diff --git a/src/render_cpu.h b/src/render_cpu.h
index 6926687..b4141ae 100644
--- a/src/render_cpu.h
+++ b/src/render_cpu.h
@@ -14,6 +14,8 @@
#include <pthread.h>
#include <math.h>
+#define COORDS(x, y, width) ((y)*(width)+(x))
+
typedef struct config_cpu {
u8 threads;
u32 *arr;