goat3d

changeset 79:a42f6cd4e2fa

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 May 2014 19:30:49 +0300
parents 53ea5b25426e
children c5e997e8fd62
files goatview/goatview.vcxproj goatview/goatview.vcxproj.filters goatview/src/goatview.cc
diffstat 3 files changed, 24 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/goatview/goatview.vcxproj	Thu May 08 16:25:04 2014 +0300
     1.2 +++ b/goatview/goatview.vcxproj	Thu May 08 19:30:49 2014 +0300
     1.3 @@ -103,7 +103,7 @@
     1.4      <Link>
     1.5        <SubSystem>Console</SubSystem>
     1.6        <GenerateDebugInformation>true</GenerateDebugInformation>
     1.7 -      <AdditionalDependencies>goat3d-x64.lib;qtmaind.lib;Qt5Cored.lib;Qt5Widgetsd.lib;Qt5OpenGLd.lib;opengl32.lib;glu32.lib;libvmath-x64-dbg.lib;libanim-x64-dbg.lib;pthreadVC2_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
     1.8 +      <AdditionalDependencies>goat3d-x64.lib;qtmaind.lib;Qt5Guid.lib;Qt5Cored.lib;Qt5Widgetsd.lib;Qt5OpenGLd.lib;opengl32.lib;glu32.lib;libvmath-x64-dbg.lib;libanim-x64-dbg.lib;pthreadVC2_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
     1.9        <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    1.10      </Link>
    1.11      <CustomBuildStep>
    1.12 @@ -156,7 +156,7 @@
    1.13        <GenerateDebugInformation>true</GenerateDebugInformation>
    1.14        <EnableCOMDATFolding>true</EnableCOMDATFolding>
    1.15        <OptimizeReferences>true</OptimizeReferences>
    1.16 -      <AdditionalDependencies>goat3d-x64.lib;qtmain.lib;Qt5Widgets.lib;Qt5OpenGL.lib;opengl32.lib;glu32.lib;libvmath-x64.lib;libanim-x64.lib;pthreadVC2_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
    1.17 +      <AdditionalDependencies>goat3d-x64.lib;qtmain.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5OpenGL.lib;opengl32.lib;glu32.lib;libvmath-x64.lib;libanim-x64.lib;pthreadVC2_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
    1.18        <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>
    1.19      </Link>
    1.20    </ItemDefinitionGroup>
    1.21 @@ -164,6 +164,7 @@
    1.22      <ClCompile Include="src\goatview.cc" />
    1.23      <ClCompile Include="src\main.cc" />
    1.24      <ClCompile Include="src\moc_goatview.cc" />
    1.25 +    <ClCompile Include="src\opengl.c" />
    1.26    </ItemGroup>
    1.27    <!--ItemGroup>
    1.28      <ClInclude Include="src\goatview.h" />
    1.29 @@ -178,6 +179,9 @@
    1.30        <Outputs>src\moc_goatview.cc</Outputs>
    1.31      </CustomBuild>
    1.32    </ItemGroup>
    1.33 +  <ItemGroup>
    1.34 +    <ClInclude Include="src\opengl.h" />
    1.35 +  </ItemGroup>
    1.36    <PropertyGroup>
    1.37      <CustomBuildAfterTargets>ClCompile</CustomBuildAfterTargets>
    1.38      <CustomBuildBeforeTargets>Link</CustomBuildBeforeTargets>
     2.1 --- a/goatview/goatview.vcxproj.filters	Thu May 08 16:25:04 2014 +0300
     2.2 +++ b/goatview/goatview.vcxproj.filters	Thu May 08 19:30:49 2014 +0300
     2.3 @@ -27,10 +27,18 @@
     2.4      <ClCompile Include="src\moc_goatview.cc">
     2.5        <Filter>moc</Filter>
     2.6      </ClCompile>
     2.7 +    <ClCompile Include="src\opengl.c">
     2.8 +      <Filter>Source Files</Filter>
     2.9 +    </ClCompile>
    2.10    </ItemGroup>
    2.11    <ItemGroup>
    2.12      <CustomBuild Include="src\goatview.h">
    2.13        <Filter>Header Files</Filter>
    2.14      </CustomBuild>
    2.15    </ItemGroup>
    2.16 +  <ItemGroup>
    2.17 +    <ClInclude Include="src\opengl.h">
    2.18 +      <Filter>Header Files</Filter>
    2.19 +    </ClInclude>
    2.20 +  </ItemGroup>
    2.21  </Project>
    2.22 \ No newline at end of file
     3.1 --- a/goatview/src/goatview.cc	Thu May 08 16:25:04 2014 +0300
     3.2 +++ b/goatview/src/goatview.cc	Thu May 08 19:30:49 2014 +0300
     3.3 @@ -1,6 +1,6 @@
     3.4  #include <stdio.h>
     3.5  #include <QtOpenGL/QtOpenGL>
     3.6 -#include <GL/glu.h>
     3.7 +#include "opengl.h"
     3.8  #include <vmath/vmath.h>
     3.9  #include "goatview.h"
    3.10  #include "goat3d.h"
    3.11 @@ -153,7 +153,9 @@
    3.12  
    3.13  void GoatViewport::initializeGL()
    3.14  {
    3.15 -	glClearColor(0.1, 0.1, 0.1, 1);
    3.16 +	init_opengl();
    3.17 +
    3.18 +	glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
    3.19  
    3.20  	glEnable(GL_DEPTH_TEST);
    3.21  	glEnable(GL_CULL_FACE);
    3.22 @@ -193,13 +195,15 @@
    3.23  	float xform[16];
    3.24  	goat3d_get_node_matrix(node, xform, anim_time);
    3.25  	for(int i=0; i<4; i++) {
    3.26 -		float *row = xform + i * 4;
    3.27 -		printf("[%3.3f %3.3f %3.3f %3.3f]\n", row[0], row[1], row[2], row[3]);
    3.28 +		for(int j=0; j<i; j++) {
    3.29 +			float tmp = xform[i * 4 + j];
    3.30 +			xform[i * 4 + j] = xform[j * 4 + i];
    3.31 +			xform[j * 4 + i] = tmp;
    3.32 +		}
    3.33  	}
    3.34 -	putchar('\n');
    3.35  
    3.36  	glPushMatrix();
    3.37 -	glMultTransposeMatrixf(xform);
    3.38 +	glLoadMatrixf(xform);
    3.39  
    3.40  	if(goat3d_get_node_type(node) == GOAT3D_NODE_MESH) {
    3.41  		goat3d_mesh *mesh = (goat3d_mesh*)goat3d_get_node_object(node);