func names are no longer mangled to death

This commit is contained in:
2025-08-25 18:22:23 -05:00
parent e626c94f4a
commit d0c1d9fb93
4 changed files with 86 additions and 24 deletions

View File

@@ -54,7 +54,7 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
@@ -66,7 +66,7 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
@@ -109,6 +109,19 @@
<OutDir>$(ProjectDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(ProjectDir)obj\$(Platform)\$(Configuration)\</IntDir>
<SourcePath>$(ProjectDir)src;$(SourcePath)</SourcePath>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)src\shaders\vertex.glsl" "$(OutDir)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)src\shaders\fragment.glsl" "$(OutDir)"</Command>
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(ProjectDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(ProjectDir)obj\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -164,7 +177,13 @@
<AdditionalDependencies>glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)"</Command>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)src\shaders\vertex.glsl" "$(OutDir)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)" &amp;&amp; xcopy /y "$(ProjectDir)src\shaders\vertex.glsl" "$(OutDir)" &amp;&amp; xcopy /y "$(ProjectDir)src\shaders\fragment.glsl" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|x64'">
@@ -181,8 +200,18 @@
<AdditionalDependencies>glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)"</Command>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)src\shaders\vertex.glsl" "$(OutDir)"</Command>
</PostBuildEvent>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)" &amp;&amp; xcopy /y "$(ProjectDir)src\shaders\vertex.glsl" "$(OutDir)" &amp;&amp; xcopy /y "$(ProjectDir)src\shaders\fragment.glsl" "$(OutDir)"</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -199,6 +228,9 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>xcopy /y "$(ProjectDir)poses.csv" "$(OutDir)" &amp;&amp; xcopy /y "$(ProjectDir)src\shaders\vertex.glsl" "$(OutDir)" &amp;&amp; xcopy /y "$(ProjectDir)src\shaders\fragment.glsl" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\body.cpp" />
@@ -210,7 +242,15 @@
<ClCompile Include="src\shaders.cpp" />
<ClCompile Include="src\util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="inc\body.hpp" />
<ClInclude Include="inc\camera.hpp" />
<ClInclude Include="inc\camera_poses.hpp" />
<ClInclude Include="inc\live_plotter.hpp" />
<ClInclude Include="inc\shaders.hpp" />
<ClInclude Include="inc\util.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@@ -40,4 +40,24 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="inc\body.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\camera.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\camera_poses.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\live_plotter.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\shaders.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inc\util.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,14 +1,16 @@
#pragma once
#define DllExport __declspec( dllexport )
#define DllExport __declspec( dllexport )
typedef unsigned long long pointid;
DllExport bool __cdecl start(int win_w, int win_h);
DllExport bool __cdecl stop();
DllExport pointid __cdecl create_point(float x, float y, float z);
DllExport void __cdecl set_color(pointid id, float r, float g, float b);
DllExport void __cdecl set_scale(pointid id, float scale);
DllExport void __cdecl update_point(pointid id, float x, float y, float z);
DllExport void __cdecl set_lifetime(pointid id, float new_lifetime_s);
DllExport void __cdecl clear_point(pointid id);
extern "C" {
DllExport bool __cdecl start(int win_w, int win_h);
DllExport bool __cdecl stop();
DllExport pointid __cdecl create_point(float x, float y, float z);
DllExport void __cdecl set_color(pointid id, float r, float g, float b);
DllExport void __cdecl set_scale(pointid id, float scale);
DllExport void __cdecl update_point(pointid id, float x, float y, float z);
DllExport void __cdecl set_lifetime(pointid id, float new_lifetime_s);
DllExport void __cdecl clear_point(pointid id);
}

View File

@@ -54,8 +54,8 @@ static std::map<uint, Point*> id_to_point; // Use a pool allocator possibly late
static std::map<Point*, uint> point_to_id;
// Constants
const char* vertex_filepath = "src/shaders/vertex.glsl";
const char* fragment_filepath = "src/shaders/fragment.glsl";
const char* vertex_filepath = "vertex.glsl";
const char* fragment_filepath = "fragment.glsl";
// Private foward decls
void _resize_cb(GLFWwindow* win, int w, int h);
@@ -67,7 +67,7 @@ bool _glfw_setup();
void _refresh_win();
double _time();
DllExport bool __cdecl start(int win_w, int win_h) {
extern DllExport bool __cdecl start(int win_w, int win_h) {
if (!InitializeCriticalSectionAndSpinCount(&cs, 0x00000400))
return false;
@@ -92,7 +92,7 @@ DllExport bool __cdecl start(int win_w, int win_h) {
return running;
}
DllExport bool __cdecl stop() {
extern DllExport bool __cdecl stop() {
stop_flag = true;
DWORD res = WaitForSingleObject(win_thread_h, STOP_WAIT_TIME_MS);
bool success = res == WAIT_OBJECT_0;
@@ -103,7 +103,7 @@ DllExport bool __cdecl stop() {
return success;
}
DllExport pointid __cdecl create_point(float x, float y, float z) {
extern DllExport pointid __cdecl create_point(float x, float y, float z) {
EnterCriticalSection(&cs);
Point* p = (Point*)malloc(sizeof(Point));
@@ -124,21 +124,21 @@ DllExport pointid __cdecl create_point(float x, float y, float z) {
return id;
}
DllExport void __cdecl set_color(pointid id, float r, float g, float b) {
extern DllExport void __cdecl set_color(pointid id, float r, float g, float b) {
EnterCriticalSection(&cs);
Point* p = id_to_point[id];
p->b.color = { r, g, b, p->b.color[3] };
LeaveCriticalSection(&cs);
}
DllExport void __cdecl set_scale(pointid id, float scale) {
extern DllExport void __cdecl set_scale(pointid id, float scale) {
EnterCriticalSection(&cs);
Point* p = id_to_point[id];
p->b.scale = scale;
LeaveCriticalSection(&cs);
}
DllExport void __cdecl update_point(pointid id, float x, float y, float z) {
extern DllExport void __cdecl update_point(pointid id, float x, float y, float z) {
EnterCriticalSection(&cs);
Point* p = id_to_point[id];
p->targetloc = { x, y, z };
@@ -147,7 +147,7 @@ DllExport void __cdecl update_point(pointid id, float x, float y, float z) {
LeaveCriticalSection(&cs);
}
DllExport void __cdecl set_lifetime(pointid id, float new_lifetime_s) {
extern DllExport void __cdecl set_lifetime(pointid id, float new_lifetime_s) {
EnterCriticalSection(&cs);
Point* p = id_to_point[id];
p->start_s = _time();
@@ -155,7 +155,7 @@ DllExport void __cdecl set_lifetime(pointid id, float new_lifetime_s) {
LeaveCriticalSection(&cs);
}
DllExport void __cdecl clear_point(pointid id) {
extern DllExport void __cdecl clear_point(pointid id) {
EnterCriticalSection(&cs);
Point* p = id_to_point[id];
id_to_point.erase(id);