Removed incomplete project stubs

This commit is contained in:
Jak Barnes 2019-04-20 13:52:44 +01:00
parent 31e9cfe2a5
commit 0561156813
16 changed files with 504 additions and 591 deletions

View File

@ -1,43 +0,0 @@
/*******************************************************************************************
*
* raylib [core] example - Basic window
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
int main()
{
int screenWidth = 800;
int screenHeight = 450;
InitWindow(
screenWidth, screenHeight, "raylib [core] example - basic window");
SetTargetFPS(60);
// Main game loop
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}

View File

@ -1,43 +0,0 @@
/*******************************************************************************************
*
* raylib [core] example - Basic window
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
int main()
{
int screenWidth = 800;
int screenHeight = 450;
InitWindow(
screenWidth, screenHeight, "raylib [core] example - basic window");
SetTargetFPS(60);
// Main game loop
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}

View File

@ -1,6 +1,6 @@
/*******************************************************************************************
*
* raylib [network] example - Resolve host
* raylib [network] example - Resolve Host
*
* Welcome to raylib!
*

View File

@ -1,43 +0,0 @@
/*******************************************************************************************
*
* raylib [core] example - Basic window
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
int main()
{
int screenWidth = 800;
int screenHeight = 450;
InitWindow(
screenWidth, screenHeight, "raylib [core] example - basic window");
SetTargetFPS(60);
// Main game loop
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
}
CloseWindow();
return 0;
}

View File

@ -1,3 +1,25 @@
/*******************************************************************************************
*
* raylib [network] example - TCP Client
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 2.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h
*for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include "rnet.c"

View File

@ -1,3 +1,25 @@
/*******************************************************************************************
*
* raylib [network] example - TCP Server
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 2.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h
*for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include "rnet.c"

View File

@ -1,3 +1,25 @@
/*******************************************************************************************
*
* raylib [network] example - Network Test
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 2.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h
*for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <assert.h>
@ -71,7 +93,7 @@ void test_resolve_host()
const char * address = "localhost";
const char * port = "80";
AddressInformation *addr = AllocAddressList(3);
int count = ResolveHost(address, port, ADDRESS_TYPE_IPV4, 0, addr);
int count = ResolveHost(address, port, ADDRESS_TYPE_ANY, 0, addr);
assert(GetAddressFamily(addr[0]) == ADDRESS_TYPE_IPV6);
assert(GetAddressFamily(addr[1]) == ADDRESS_TYPE_IPV4);
@ -109,8 +131,8 @@ int main()
// Run the tests
test_network_initialise();
// test_resolve_host();
test_socket_create();
test_resolve_host();
// test_socket_create();
// Main game loop
while (!WindowShouldClose()) {

View File

@ -1,3 +1,25 @@
/*******************************************************************************************
*
* raylib [network] example - UDP Client
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 2.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h
*for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <assert.h>

View File

@ -1,3 +1,25 @@
/*******************************************************************************************
*
* raylib [network] example - UDP Server
*
* Welcome to raylib!
*
* To test examples, just press F6 and execute raylib_compile_execute script
* Note that compiled executable is placed in the same folder as .c file
*
* You can find all basic examples on C:\raylib\raylib\examples folder or
* raylib official webpage: www.raylib.com
*
* Enjoy using raylib. :)
*
* This example has been created using raylib 2.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h
*for details)
*
* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#include <assert.h>

View File

@ -22,14 +22,14 @@
<ProjectGuid>{0981CA98-E4A5-4DF1-987F-A41D09131EFC}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>core_basic_window</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>core_basic_window</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration">

View File

@ -22,14 +22,14 @@
<ProjectGuid>{B655E850-3322-42F7-941D-6AC18FD66CA1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>raylib_example_cpp</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>core_basic_window_cpp</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug.DLL|Win32'" Label="Configuration">

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2024
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}"
EndProject
@ -11,10 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{87
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core_basic_window", "examples\core_basic_window.vcxproj", "{0981CA98-E4A5-4DF1-987F-A41D09131EFC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_chat_client", "examples\network_chat_client.vcxproj", "{80AE5E50-FAC7-434F-A898-2878568E7D79}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_chat_server", "examples\network_chat_server.vcxproj", "{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_ping_pong", "examples\network_ping_pong.vcxproj", "{56EB485C-00A9-459E-B758-2E86316EB7FD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network_resolve_host", "examples\network_resolve_host.vcxproj", "{A16D19CB-6AF4-4D17-8318-EABD8805247C}"
@ -79,38 +75,6 @@ Global
{0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x64.ActiveCfg = Release|Win32
{0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.ActiveCfg = Release|Win32
{0981CA98-E4A5-4DF1-987F-A41D09131EFC}.Release|x86.Build.0 = Release|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug.DLL|x64.ActiveCfg = Debug|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug.DLL|x64.Build.0 = Debug|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug.DLL|x86.ActiveCfg = Debug|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug.DLL|x86.Build.0 = Debug|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug|x64.ActiveCfg = Debug|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug|x64.Build.0 = Debug|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug|x86.ActiveCfg = Debug|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Debug|x86.Build.0 = Debug|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release.DLL|x64.ActiveCfg = Release|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release.DLL|x64.Build.0 = Release|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release.DLL|x86.ActiveCfg = Release|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release.DLL|x86.Build.0 = Release|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release|x64.ActiveCfg = Release|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release|x64.Build.0 = Release|x64
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release|x86.ActiveCfg = Release|Win32
{80AE5E50-FAC7-434F-A898-2878568E7D79}.Release|x86.Build.0 = Release|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug.DLL|x64.ActiveCfg = Debug|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug.DLL|x64.Build.0 = Debug|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug.DLL|x86.ActiveCfg = Debug|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug.DLL|x86.Build.0 = Debug|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug|x64.ActiveCfg = Debug|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug|x64.Build.0 = Debug|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug|x86.ActiveCfg = Debug|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Debug|x86.Build.0 = Debug|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release.DLL|x64.ActiveCfg = Release|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release.DLL|x64.Build.0 = Release|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release.DLL|x86.ActiveCfg = Release|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release.DLL|x86.Build.0 = Release|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release|x64.ActiveCfg = Release|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release|x64.Build.0 = Release|x64
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release|x86.ActiveCfg = Release|Win32
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D}.Release|x86.Build.0 = Release|Win32
{56EB485C-00A9-459E-B758-2E86316EB7FD}.Debug.DLL|x64.ActiveCfg = Debug|x64
{56EB485C-00A9-459E-B758-2E86316EB7FD}.Debug.DLL|x64.Build.0 = Debug|x64
{56EB485C-00A9-459E-B758-2E86316EB7FD}.Debug.DLL|x86.ActiveCfg = Debug|Win32
@ -242,8 +206,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{B655E850-3322-42F7-941D-6AC18FD66CA1} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}
{0981CA98-E4A5-4DF1-987F-A41D09131EFC} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}
{80AE5E50-FAC7-434F-A898-2878568E7D79} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}
{BC49AAF0-E8C2-4F94-A60A-C56993023C6D} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}
{56EB485C-00A9-459E-B758-2E86316EB7FD} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}
{A16D19CB-6AF4-4D17-8318-EABD8805247C} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}
{46B18968-56BC-4FB1-A7C0-FA418E095AFD} = {8716DC0F-4FDE-4F57-8E25-5F78DFB80FE1}

View File

@ -22,7 +22,7 @@
<ProjectGuid>{E89D61AC-55DE-4482-AFD4-DF7242EBC859}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>raylib</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -163,6 +163,7 @@
<ClCompile Include="..\..\..\src\core.c" />
<ClCompile Include="..\..\..\src\models.c" />
<ClCompile Include="..\..\..\src\rglfw.c" />
<ClCompile Include="..\..\..\src\rnet.c" />
<ClCompile Include="..\..\..\src\shapes.c" />
<ClCompile Include="..\..\..\src\text.c" />
<ClCompile Include="..\..\..\src\textures.c" />
@ -184,6 +185,7 @@
<ClInclude Include="..\..\..\src\raylib.h" />
<ClInclude Include="..\..\..\src\raymath.h" />
<ClInclude Include="..\..\..\src\rlgl.h" />
<ClInclude Include="..\..\..\src\rnet.h" />
<ClInclude Include="..\..\..\src\utils.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -519,8 +519,8 @@ typedef struct SocketOpt
typedef enum
{
SOCKET_TCP = 1, // SOCK_STREAM
SOCKET_UDP = 2 // SOCK_DGRAM
SOCKET_TCP = 0, // SOCK_STREAM
SOCKET_UDP = 1 // SOCK_DGRAM
} SocketType;
typedef struct UDPChannel

View File

@ -62,18 +62,22 @@ typedef struct _SocketAddress
{
struct sockaddr address;
} _SocketAddress;
typedef struct _SocketAddressIPv4
{
struct sockaddr_in address;
} _SocketAddressIPv4;
typedef struct _SocketAddressIPv6
{
struct sockaddr_in6 address;
} _SocketAddressIPv6;
typedef struct _SocketAddressStorage
{
struct sockaddr_storage address;
} _SocketAddressStorage;
typedef struct _AddressInformation
{
struct addrinfo addr;
@ -310,7 +314,9 @@ static bool InitSocket(Socket *sock, struct addrinfo *addr)
sock->channel = socket(AF_INET6, SOCK_DGRAM, 0);
}
break;
default: break;
default:
TraceLog(LOG_WARNING, "Invalid socket type specified.");
break;
}
return IsSocketValid(sock);
}
@ -1005,6 +1011,10 @@ bool SocketListen(SocketConfig *config, SocketResult *result)
else
{
success = false;
result->socket->status = SocketGetLastError();
TraceLog(LOG_WARNING, "Socket Error: %s",
SocketErrorCodeToString(result->socket->status));
SocketSetLastError(0);
}
}
else
@ -1813,48 +1823,6 @@ int CheckSockets(SocketSet *set, unsigned int timeout)
return (retval);
}
// Allocate a Packet
// Packet *AllocPacket(int size)
// {
// struct Packet *packet;
// packet = (struct Packet *) malloc(sizeof(*packet));
// if (packet != NULL)
// {
// memset(packet, 0, sizeof(*packet));
// packet->size = 0;
// packet->offs = 0;
// packet->maxs = size;
// packet->data = (uint8_t *) malloc(size * sizeof(uint8_t));
// memset(packet->data, '\0', size);
// if (packet->data == NULL)
// {
// free(packet);
// packet = NULL;
// }
// }
// else
// {
// free(packet);
// packet = NULL;
// }
// return packet;
// }
// Free an allocated Packet
// void FreePacket(Packet *packet)
// {
// if (packet != NULL)
// {
// if (packet->data != NULL)
// {
// free(packet->data);
// packet->data = NULL;
// }
// free(packet);
// packet = NULL;
// }
// }
// Allocate an AddressInformation
AddressInformation AllocAddress()
{