actually find the parser bug (not handling lines that end in \r\n). formatting changes. comment out functions b/c clang can't be bothered to generate generic function defs if the function that uses it isn't actually part of the main program
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LibraryPath>$(SolutionDir)ext\pthreads4w-code\build\Debug;$(SolutionDir)ext\glfw\build\src\Debug;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
|
||||
<LibraryPath>$(SolutionDir)lib;$(SolutionDir)ext\pthreads4w-code\build\Debug;$(SolutionDir)ext\glfw\build\src\Debug;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
|
||||
<IncludePath>$(SolutionDir)ext\pthreads4w-code;$(SolutionDir)ext\glm;$(SolutionDir)ext\glfw\include;$(SolutionDir)inc;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
@@ -146,4 +146,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -30,5 +30,8 @@
|
||||
<ClCompile Include="src\body.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tcp_server.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,37 +1,37 @@
|
||||
[
|
||||
{
|
||||
"directory": "C:/Users/sethh/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/sethh/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/sethh/Documents/repos/LivePlotter/src/shaders.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/atlmfc/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/cppwinrt\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/sethh/Documents/repos/LivePlotter/src/shaders.cpp"
|
||||
"directory": "C:/Users/seth/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/seth/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/seth/Documents/repos/LivePlotter/src/util.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/cppwinrt\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/seth/Documents/repos/LivePlotter/src/util.cpp"
|
||||
}
|
||||
,
|
||||
{
|
||||
"directory": "C:/Users/sethh/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/sethh/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/sethh/Documents/repos/LivePlotter/src/main.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/atlmfc/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/cppwinrt\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/sethh/Documents/repos/LivePlotter/src/main.cpp"
|
||||
"directory": "C:/Users/seth/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/seth/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/seth/Documents/repos/LivePlotter/src/shaders.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/cppwinrt\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/seth/Documents/repos/LivePlotter/src/shaders.cpp"
|
||||
}
|
||||
,
|
||||
{
|
||||
"directory": "C:/Users/sethh/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/sethh/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/sethh/Documents/repos/LivePlotter/src/util.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/atlmfc/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/cppwinrt\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/sethh/Documents/repos/LivePlotter/src/util.cpp"
|
||||
"directory": "C:/Users/seth/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/seth/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/seth/Documents/repos/LivePlotter/src/tcp_server.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/cppwinrt\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/seth/Documents/repos/LivePlotter/src/tcp_server.cpp"
|
||||
}
|
||||
,
|
||||
{
|
||||
"directory": "C:/Users/sethh/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/sethh/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/sethh/Documents/repos/LivePlotter/src/tcp_server.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/atlmfc/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/cppwinrt\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/sethh/Documents/repos/LivePlotter/src/tcp_server.cpp"
|
||||
"directory": "C:/Users/seth/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/seth/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/seth/Documents/repos/LivePlotter/src/body.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/cppwinrt\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/seth/Documents/repos/LivePlotter/src/body.cpp"
|
||||
}
|
||||
,
|
||||
{
|
||||
"directory": "C:/Users/sethh/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/sethh/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c \"C:/Users/sethh/Documents/repos/LivePlotter/src/glad.c\" -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/atlmfc/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/cppwinrt\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/sethh/Documents/repos/LivePlotter/src/glad.c"
|
||||
"directory": "C:/Users/seth/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/seth/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/seth/Documents/repos/LivePlotter/src/main.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/cppwinrt\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/seth/Documents/repos/LivePlotter/src/main.cpp"
|
||||
}
|
||||
,
|
||||
{
|
||||
"directory": "C:/Users/sethh/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/sethh/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c++ \"C:/Users/sethh/Documents/repos/LivePlotter/src/body.cpp\" -std=c++20 -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/atlmfc/include\" -isystem\"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/cppwinrt\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/sethh/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/sethh/Documents/repos/LivePlotter/src/body.cpp"
|
||||
"directory": "C:/Users/seth/Documents/repos/LivePlotter/",
|
||||
"command": "\"C:/Users/seth/AppData/Roaming/ClangPowerTools/LLVM_Lite/Bin/clang++.exe\" -x c \"C:/Users/seth/Documents/repos/LivePlotter/src/glad.c\" -Wall -fms-compatibility-version=19.10 -Wmicrosoft -Wno-invalid-token-paste -Wno-unknown-pragmas -Wno-unused-value -fsyntax-only \"-DUNICODE\" \"-D_UNICODE\" \"-D_MT\" \"-D_DLL\" \"-D_DEBUG\" \"-D_CONSOLE\" \"-D_DEBUG_FUNCTIONAL_MACHINERY\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/atlmfc/include\" -isystem\"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/VS/include\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/ucrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/winrt\" -isystem\"C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/cppwinrt\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/pthreads4w-code\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glm\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/ext/glfw/include\" -isystem\"C:/Users/seth/Documents/repos/LivePlotter/inc\"",
|
||||
"file": "C:/Users/seth/Documents/repos/LivePlotter/src/glad.c"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -10,7 +10,7 @@ struct tcpserver {
|
||||
SOCKET sock;
|
||||
array<SOCKET> client_socks;
|
||||
int max_connections;
|
||||
addrinfo *addr;
|
||||
addrinfo* addr;
|
||||
array<data_received_cb_t> cbs;
|
||||
|
||||
pthread_mutex_t lock;
|
||||
@@ -18,8 +18,8 @@ struct tcpserver {
|
||||
pthread_cond_t stop_requested;
|
||||
};
|
||||
|
||||
bool create_server(tcpserver *server_out, const char* hostname, int port);
|
||||
void start_server(tcpserver &s);
|
||||
void stop_server(tcpserver &s);
|
||||
void send_data(tcpserver &s, SOCKET client, array<char> data);
|
||||
void register_recv_cb(tcpserver &s, data_received_cb_t cb);
|
||||
bool create_server(tcpserver* server_out, const char* hostname, int port, int max_connections);
|
||||
void start_server(tcpserver& s);
|
||||
void stop_server(tcpserver& s);
|
||||
void send_data(tcpserver& s, SOCKET client, array<char> data);
|
||||
void register_recv_cb(tcpserver& s, data_received_cb_t cb);
|
||||
|
||||
@@ -14,5 +14,5 @@ template<class T> struct array {
|
||||
|
||||
template<class T> void append(array<T>& a, T el);
|
||||
template<class T> T pop(array<T>& a);
|
||||
template<class T> void resize(array<T>& a, size_t new_size);
|
||||
template<class T> void resize(array<T>& a, size_t new_cap);
|
||||
bool read_file(array<char>* out, const char* filepath);
|
||||
|
||||
@@ -67,7 +67,7 @@ bool load_body(body* out_body, const char* obj_filepath) {
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
if (source[i] == '\n') {
|
||||
if (source[i] == '\n' || source[i] == '\r') {
|
||||
state = ParserState::PREFIX;
|
||||
continue;
|
||||
}
|
||||
|
||||
25
src/main.cpp
25
src/main.cpp
@@ -8,11 +8,12 @@
|
||||
#include "util.hpp"
|
||||
#include "shaders.hpp"
|
||||
#include "body.hpp"
|
||||
#include "tcp_server.hpp"
|
||||
|
||||
static GLFWwindow* window;
|
||||
static float width, height;
|
||||
|
||||
void framebuffer_size_callback(GLFWwindow* window, int w, int h) {
|
||||
void framebuffer_size_callback(GLFWwindow* window, int w, int h) {
|
||||
width = w;
|
||||
height = h;
|
||||
glViewport(0, 0, width, height);
|
||||
@@ -21,7 +22,6 @@ void framebuffer_size_callback(GLFWwindow* window, int w, int h) {
|
||||
void process_input() {
|
||||
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, true);
|
||||
|
||||
}
|
||||
|
||||
static bool mouse_pressed = false;
|
||||
@@ -50,7 +50,7 @@ static void cursor_position_callback(GLFWwindow* window, double xpos, double ypo
|
||||
}
|
||||
|
||||
if (scroll_pressed) {
|
||||
focal_point += strafe_x * (dx/300) + strafe_y * (dy/300);
|
||||
focal_point += strafe_x * (dx / 300) + strafe_y * (dy / 300);
|
||||
}
|
||||
|
||||
double len = glm::length(camera_loc);
|
||||
@@ -75,12 +75,11 @@ void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||
glfwGetCursorPos(window, &prev_cursor_x, &prev_cursor_y);
|
||||
}
|
||||
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
|
||||
{
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) {
|
||||
glm::vec4 k = camera_t[2];
|
||||
float d = yoffset;
|
||||
|
||||
camera_loc += k * (d/10 * glm::max(glm::length(camera_loc), 1.0f));
|
||||
camera_loc += k * (d / 10 * max(glm::length(camera_loc), 1.0f));
|
||||
|
||||
camera_t = glm::lookAt(camera_loc, focal_point, up);
|
||||
}
|
||||
@@ -107,8 +106,12 @@ bool glfw_setup() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int main() {
|
||||
//tcpserver server;
|
||||
//if (!create_server(&server, "127.0.0.1", 5000, 1)) {
|
||||
// //return -1;
|
||||
//}
|
||||
|
||||
if (!glfw_setup())
|
||||
return -1;
|
||||
|
||||
@@ -126,7 +129,7 @@ int main() {
|
||||
if (!load_shader(&shader, vertex_filepath, fragment_filepath))
|
||||
return -1;
|
||||
|
||||
//glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
|
||||
// glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
|
||||
glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT); // Write to back buffer
|
||||
|
||||
@@ -147,9 +150,9 @@ int main() {
|
||||
b2.pose = glm::translate(b.pose, glm::vec3(2, 0, 0));
|
||||
b2.color = glm::vec4(0, 0.5, 0, 1);
|
||||
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
//set_uniform(shader, "color", glm::vec4 { sin(time), sin(time + glm::radians(45.0f)), sin(time + glm::radians(90.0f)), 1.0 } / 2.0f);
|
||||
//time = glfwGetTime();
|
||||
// glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
// set_uniform(shader, "color", glm::vec4 { sin(time), sin(time + glm::radians(45.0f)), sin(time +
|
||||
// glm::radians(90.0f)), 1.0 } / 2.0f); time = glfwGetTime();
|
||||
|
||||
glDisable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <WS2tcpip.h>
|
||||
#include <cstring>
|
||||
#pragma comment(lib, "pthreadVC3d.lib")
|
||||
#pragma comment(lib, "WS2_32.Lib")
|
||||
|
||||
// I hate windows. I hate windows. I hate windows.
|
||||
|
||||
@@ -26,20 +27,21 @@ bool create_server(tcpserver* server_out, const char* hostname, int port, int ma
|
||||
winsock_initialized = true;
|
||||
return false;
|
||||
}
|
||||
SOCKET sock;
|
||||
|
||||
// ********** Addr Info Creation **********
|
||||
addrinfo *result, *ptr, hints;
|
||||
addrinfo *result, hints;
|
||||
char port_str[16];
|
||||
_itoa_s(port, port_str, 10);
|
||||
// TODO: Ensure hostname is null-terminated
|
||||
int status = getaddrinfo(hostname, port_str, &hints, result);
|
||||
int status = getaddrinfo(hostname, port_str, &hints, &result);
|
||||
if (status != 0) {
|
||||
printf("Error at getaddrinfo(): %d\n", status);
|
||||
goto fail_cleanup;
|
||||
}
|
||||
|
||||
// *********** Socket Creation ************
|
||||
SOCKET sock = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
|
||||
sock = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
|
||||
if (sock == INVALID_SOCKET) {
|
||||
printf("Error at socket(): %d\n", WSAGetLastError());
|
||||
freeaddrinfo(result);
|
||||
@@ -65,35 +67,36 @@ fail_cleanup:
|
||||
void start_server(tcpserver& s) { }
|
||||
void stop_server(tcpserver& s) { }
|
||||
void send_data(tcpserver& s, SOCKET client, array<char> data) { }
|
||||
void register_cb(tcpserver& s, data_received_cb_t cb) { append(s.cbs, cb); }
|
||||
//void register_recv_cb(tcpserver& s, data_received_cb_t cb) { append(s.cbs, cb); }
|
||||
|
||||
void _server_loop(void* args) {
|
||||
tcpserver* s = static_cast<tcpserver*>(args);
|
||||
|
||||
int num_connections = 0;
|
||||
int slots[s->max_connections];
|
||||
array<int> open_slots
|
||||
= { .data = slots, .len = (size_t)s->max_connections, .cap = (size_t)s->max_connections };
|
||||
for (int i = 0; i < open_slots.len; i++) {
|
||||
open_slots[i] = open_slots.len - (i + 1);
|
||||
}
|
||||
|
||||
SOCKET clients[s->max_connections];
|
||||
memset(clients, INVALID_SOCKET, sizeof(SOCKET));
|
||||
while (true) {
|
||||
while (num_connections < s->max_connections) {
|
||||
int slot = pop(open_slots);
|
||||
clients[slot] = accept(s->sock, NULL, NULL);
|
||||
// TODO: More robust handling of bad client sockets
|
||||
if (clients[slot] == INVALID_SOCKET) {
|
||||
printf("Error at accept(): %d\n", WSAGetLastError());
|
||||
stop_server(*s);
|
||||
return;
|
||||
}
|
||||
_start_conn_loop(clients[slot]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//void _server_loop(void* args) {
|
||||
// tcpserver* s = static_cast<tcpserver*>(args);
|
||||
//
|
||||
// int num_connections = 0;
|
||||
// int mc = s->max_connections;
|
||||
// array<int> open_slots = {
|
||||
// .data = (int*)malloc(sizeof(int)*mc), .len = (size_t)mc, .cap = (size_t)mc
|
||||
// };
|
||||
// for (int i = 0; i < open_slots.len; i++) {
|
||||
// open_slots[i] = open_slots.len - (i + 1);
|
||||
// }
|
||||
//
|
||||
// array<SOCKET> clients = { (SOCKET*)malloc(sizeof(SOCKET) * mc), (size_t)mc, (size_t)mc };
|
||||
// memset(clients.data, INVALID_SOCKET, sizeof(SOCKET)*mc);
|
||||
// while (true) {
|
||||
// while (num_connections < s->max_connections) {
|
||||
// int slot = pop(open_slots);
|
||||
// clients[slot] = accept(s->sock, NULL, NULL);
|
||||
// // TODO: More robust handling of bad client sockets
|
||||
// if (clients[slot] == INVALID_SOCKET) {
|
||||
// printf("Error at accept(): %d\n", WSAGetLastError());
|
||||
// stop_server(*s);
|
||||
// return;
|
||||
// }
|
||||
// _start_conn_loop(clients[slot]);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
void _start_conn_loop(SOCKET client_s) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user