curvedraw
changeset 5:2b7ae76c173f
windows port
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 18 Dec 2015 03:47:10 +0200 |
parents | 9f75208b81cd |
children | 6e980fddbf3b |
files | curvedraw.sln curvedraw.vcxproj curvedraw.vcxproj.filters src/app.cc src/curve.cc src/opengl.h src/widgets.cc |
diffstat | 7 files changed, 165 insertions(+), 9 deletions(-) [+] |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/curvedraw.sln Fri Dec 18 03:47:10 2015 +0200 1.3 @@ -0,0 +1,22 @@ 1.4 + 1.5 +Microsoft Visual Studio Solution File, Format Version 12.00 1.6 +# Visual Studio 2013 1.7 +VisualStudioVersion = 12.0.31101.0 1.8 +MinimumVisualStudioVersion = 10.0.40219.1 1.9 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curvedraw", "curvedraw.vcxproj", "{04CA7CB1-80DB-4E89-8FD3-54715CDA43CE}" 1.10 +EndProject 1.11 +Global 1.12 + GlobalSection(SolutionConfigurationPlatforms) = preSolution 1.13 + Debug|Win32 = Debug|Win32 1.14 + Release|Win32 = Release|Win32 1.15 + EndGlobalSection 1.16 + GlobalSection(ProjectConfigurationPlatforms) = postSolution 1.17 + {04CA7CB1-80DB-4E89-8FD3-54715CDA43CE}.Debug|Win32.ActiveCfg = Debug|Win32 1.18 + {04CA7CB1-80DB-4E89-8FD3-54715CDA43CE}.Debug|Win32.Build.0 = Debug|Win32 1.19 + {04CA7CB1-80DB-4E89-8FD3-54715CDA43CE}.Release|Win32.ActiveCfg = Release|Win32 1.20 + {04CA7CB1-80DB-4E89-8FD3-54715CDA43CE}.Release|Win32.Build.0 = Release|Win32 1.21 + EndGlobalSection 1.22 + GlobalSection(SolutionProperties) = preSolution 1.23 + HideSolutionNode = FALSE 1.24 + EndGlobalSection 1.25 +EndGlobal
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/curvedraw.vcxproj Fri Dec 18 03:47:10 2015 +0200 2.3 @@ -0,0 +1,97 @@ 2.4 +<?xml version="1.0" encoding="utf-8"?> 2.5 +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 2.6 + <ItemGroup Label="ProjectConfigurations"> 2.7 + <ProjectConfiguration Include="Debug|Win32"> 2.8 + <Configuration>Debug</Configuration> 2.9 + <Platform>Win32</Platform> 2.10 + </ProjectConfiguration> 2.11 + <ProjectConfiguration Include="Release|Win32"> 2.12 + <Configuration>Release</Configuration> 2.13 + <Platform>Win32</Platform> 2.14 + </ProjectConfiguration> 2.15 + </ItemGroup> 2.16 + <PropertyGroup Label="Globals"> 2.17 + <ProjectGuid>{04CA7CB1-80DB-4E89-8FD3-54715CDA43CE}</ProjectGuid> 2.18 + <Keyword>Win32Proj</Keyword> 2.19 + <RootNamespace>curvedraw</RootNamespace> 2.20 + </PropertyGroup> 2.21 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> 2.22 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> 2.23 + <ConfigurationType>Application</ConfigurationType> 2.24 + <UseDebugLibraries>true</UseDebugLibraries> 2.25 + <PlatformToolset>v120</PlatformToolset> 2.26 + <CharacterSet>MultiByte</CharacterSet> 2.27 + </PropertyGroup> 2.28 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> 2.29 + <ConfigurationType>Application</ConfigurationType> 2.30 + <UseDebugLibraries>false</UseDebugLibraries> 2.31 + <PlatformToolset>v120</PlatformToolset> 2.32 + <WholeProgramOptimization>false</WholeProgramOptimization> 2.33 + <CharacterSet>MultiByte</CharacterSet> 2.34 + </PropertyGroup> 2.35 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> 2.36 + <ImportGroup Label="ExtensionSettings"> 2.37 + </ImportGroup> 2.38 + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 2.39 + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 2.40 + </ImportGroup> 2.41 + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> 2.42 + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 2.43 + </ImportGroup> 2.44 + <PropertyGroup Label="UserMacros" /> 2.45 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 2.46 + <LinkIncremental>true</LinkIncremental> 2.47 + </PropertyGroup> 2.48 + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> 2.49 + <LinkIncremental>false</LinkIncremental> 2.50 + </PropertyGroup> 2.51 + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 2.52 + <ClCompile> 2.53 + <PrecompiledHeader> 2.54 + </PrecompiledHeader> 2.55 + <WarningLevel>Level3</WarningLevel> 2.56 + <Optimization>Disabled</Optimization> 2.57 + <PreprocessorDefinitions>WIN32;FREEGLUT_LIB_PRAGMAS=0;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> 2.58 + <DisableSpecificWarnings>4244;4996;4305</DisableSpecificWarnings> 2.59 + </ClCompile> 2.60 + <Link> 2.61 + <SubSystem>Console</SubSystem> 2.62 + <GenerateDebugInformation>true</GenerateDebugInformation> 2.63 + <AdditionalDependencies>freeglut.lib;libdrawtext.lib;opengl32.lib;glu32.lib;glew32.lib;libvmath-dbg.lib;%(AdditionalDependencies)</AdditionalDependencies> 2.64 + </Link> 2.65 + </ItemDefinitionGroup> 2.66 + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> 2.67 + <ClCompile> 2.68 + <WarningLevel>Level3</WarningLevel> 2.69 + <PrecompiledHeader> 2.70 + </PrecompiledHeader> 2.71 + <Optimization>MaxSpeed</Optimization> 2.72 + <FunctionLevelLinking>true</FunctionLevelLinking> 2.73 + <IntrinsicFunctions>true</IntrinsicFunctions> 2.74 + <PreprocessorDefinitions>WIN32;FREEGLUT_LIB_PRAGMAS=0;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> 2.75 + <DisableSpecificWarnings>4244;4996;4305</DisableSpecificWarnings> 2.76 + </ClCompile> 2.77 + <Link> 2.78 + <SubSystem>Console</SubSystem> 2.79 + <GenerateDebugInformation>true</GenerateDebugInformation> 2.80 + <EnableCOMDATFolding>true</EnableCOMDATFolding> 2.81 + <OptimizeReferences>true</OptimizeReferences> 2.82 + <AdditionalDependencies>freeglut.lib;libdrawtext.lib;opengl32.lib;glu32.lib;glew32.lib;libvmath.lib;%(AdditionalDependencies)</AdditionalDependencies> 2.83 + </Link> 2.84 + </ItemDefinitionGroup> 2.85 + <ItemGroup> 2.86 + <ClCompile Include="src\app.cc" /> 2.87 + <ClCompile Include="src\curve.cc" /> 2.88 + <ClCompile Include="src\main.cc" /> 2.89 + <ClCompile Include="src\widgets.cc" /> 2.90 + </ItemGroup> 2.91 + <ItemGroup> 2.92 + <ClInclude Include="src\app.h" /> 2.93 + <ClInclude Include="src\curve.h" /> 2.94 + <ClInclude Include="src\opengl.h" /> 2.95 + <ClInclude Include="src\widgets.h" /> 2.96 + </ItemGroup> 2.97 + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> 2.98 + <ImportGroup Label="ExtensionTargets"> 2.99 + </ImportGroup> 2.100 +</Project> 2.101 \ No newline at end of file
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/curvedraw.vcxproj.filters Fri Dec 18 03:47:10 2015 +0200 3.3 @@ -0,0 +1,37 @@ 3.4 +<?xml version="1.0" encoding="utf-8"?> 3.5 +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 3.6 + <ItemGroup> 3.7 + <Filter Include="src"> 3.8 + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> 3.9 + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;h</Extensions> 3.10 + </Filter> 3.11 + </ItemGroup> 3.12 + <ItemGroup> 3.13 + <ClCompile Include="src\app.cc"> 3.14 + <Filter>src</Filter> 3.15 + </ClCompile> 3.16 + <ClCompile Include="src\curve.cc"> 3.17 + <Filter>src</Filter> 3.18 + </ClCompile> 3.19 + <ClCompile Include="src\main.cc"> 3.20 + <Filter>src</Filter> 3.21 + </ClCompile> 3.22 + <ClCompile Include="src\widgets.cc"> 3.23 + <Filter>src</Filter> 3.24 + </ClCompile> 3.25 + </ItemGroup> 3.26 + <ItemGroup> 3.27 + <ClInclude Include="src\app.h"> 3.28 + <Filter>src</Filter> 3.29 + </ClInclude> 3.30 + <ClInclude Include="src\curve.h"> 3.31 + <Filter>src</Filter> 3.32 + </ClInclude> 3.33 + <ClInclude Include="src\opengl.h"> 3.34 + <Filter>src</Filter> 3.35 + </ClInclude> 3.36 + <ClInclude Include="src\widgets.h"> 3.37 + <Filter>src</Filter> 3.38 + </ClInclude> 3.39 + </ItemGroup> 3.40 +</Project> 3.41 \ No newline at end of file
4.1 --- a/src/app.cc Thu Dec 17 07:22:14 2015 +0200 4.2 +++ b/src/app.cc Fri Dec 18 03:47:10 2015 +0200 4.3 @@ -44,6 +44,8 @@ 4.4 4.5 bool app_init(int argc, char **argv) 4.6 { 4.7 + glewInit(); 4.8 + 4.9 glEnable(GL_MULTISAMPLE); 4.10 glEnable(GL_CULL_FACE); 4.11
5.1 --- a/src/curve.cc Thu Dec 17 07:22:14 2015 +0200 5.2 +++ b/src/curve.cc Fri Dec 18 03:47:10 2015 +0200 5.3 @@ -1,4 +1,5 @@ 5.4 #include <float.h> 5.5 +#include <algorithm> 5.6 #include "curve.h" 5.7 5.8 Curve::Curve(CurveType type)
6.1 --- a/src/opengl.h Thu Dec 17 07:22:14 2015 +0200 6.2 +++ b/src/opengl.h Fri Dec 18 03:47:10 2015 +0200 6.3 @@ -1,14 +1,6 @@ 6.4 #ifndef OPENGL_H_ 6.5 #define OPENGL_H_ 6.6 6.7 -#ifdef WIN32 6.8 -#include <windows.h> 6.9 -#endif 6.10 - 6.11 -#ifdef __APPLE__ 6.12 -#include <OpenGL/gl.h> 6.13 -#else 6.14 -#include <GL/gl.h> 6.15 -#endif 6.16 +#include <GL/glew.h> 6.17 6.18 #endif // OPENGL_H_
7.1 --- a/src/widgets.cc Thu Dec 17 07:22:14 2015 +0200 7.2 +++ b/src/widgets.cc Fri Dec 18 03:47:10 2015 +0200 7.3 @@ -2,6 +2,11 @@ 7.4 #include <stdlib.h> 7.5 #include <string.h> 7.6 #include <stdarg.h> 7.7 +#ifdef _MSC_VER 7.8 +#include <malloc.h> 7.9 +#else 7.10 +#include <alloca.h> 7.11 +#endif 7.12 #include <drawtext.h> 7.13 #include "opengl.h" 7.14 #include "widgets.h"