Commit Graph

12 Commits

Author SHA1 Message Date
Bubblegumdrop
d2d7c82ca4 Split SafeUDPpacket and SafeUDPpacketV.
SafeUDPpacketV is much more complex due to the UDP packet splitting machinery.
2022-01-16 17:55:26 -05:00
Bubblegumdrop
603515dd3e Merge UDPpacketVBuffer and SafeUDPpacketV.
The tests seem to work:

	./test/test_FileIO ./test/test_FileIO

	./test/test_FileIO ./test/test_FileIO | \
		./test/test_SafeUDPpacket -f -

	./test/test_SafeUDPpacket -f ./test/test_SafeUDPpacket
2022-01-16 17:47:04 -05:00
Bubblegumdrop
60e282929f Add a "SafeUDPpacket" and "SafeUDPpacketV" class.
I'm trying to merge UDPpacketVBuffer and SafeUDPpacketV.

Seems pretty messy so far... hopefully this is fruitful.
2022-01-16 14:40:20 -05:00
Bubblegumdrop
dcbd011582 Uncommitted changes.
Quite a bit going on in here.

- Messing with shaders
- Move ShaderProgram to std::unique_ptr

These are part of efforts to clean up the ShaderProgram class to have a
better interface.

- Working on shell-ing out commands.

This is pointless but getting me in the state of thinking about the
system as a whole - e.g. "stop" at the "prompt" should "stop the
server," so the prompt thread will need to communicate with the main
thread. We already have event signalling in place for this.

- Triangle strip cube

Performance testing reasons. Not being used for now.

- Remove TCP stuff from UDPbase. It only does UDP now.
2022-01-13 12:15:07 -05:00
Bubblegumdrop
2403f060eb Add SHADER_PROGRAM_REFRESH, and a bunch of debug crap because of events.
So when PACKET_SDL_EVENT was SDL_USEREVENT, things worked fine in the
main loop it would see SDL_USEREVENT and send it off to my_SDL_UserEvent.

But when I started adding more events, the SDL_UserEvent paradigm given
in the SDL Wiki stopped working.

The example here is broken: https://wiki.libsdl.org/SDL_AddTimer
The example here is working and "correct": https://wiki.libsdl.org/SDL_UserEvent

All SDL_RegisterEvents is increase a static counter. SDL doesn't
actually use these events anyway. It's purely symbolic, as far as I can tell.

So anyway. Now events work after a bunch of debugging.

SHADER_PROGRAM_REFRESH is the second user event I've done.

The ShaderProgram runs an SDL_TimerID that looks at mVertexPath,
mGeometryPath if present, and mFragmentPath. mVertexPath and
mFragmentPath are required by Compile3ShaderBuffers.
In the future I'd like to change the way this class behaves.
2022-01-09 23:37:48 -05:00
Bubblegumdrop
0fbcdbbabb Investigating strange crash.
I don't think it was actually crashing, the server is programmed to exit
on Return (empty line) at the prompt.
2022-01-09 09:53:05 -05:00
Bubblegumdrop
0cad56c8c6 Client and Server communication functionality repaired.
test_UDPpacketVBuffer for testing.
2022-01-08 23:36:08 -05:00
Bubblegumdrop
764ebe4ce2 Another Buffer_To_UDPPacketV. Yet to test.
Split UDPbase out.

Change ShaderProgram to std::unique_ptr<ShaderProgram>.

I think I may change Buffer_To_UDPPacketV  to some kind of RAII style code.
2022-01-08 21:23:42 -05:00
Bubblegumdrop
9e957d466f Client and Server tweaks. This commit breaks the Client.
Server listens correctly with threads and stdin reader thread.

Client does nothing currently gutting UDP_Write for a UDPbase class
introduced in this commit.
2022-01-08 18:59:40 -05:00
Bubblegumdrop
0264283b6e Dump UDP packets 2022-01-04 09:05:11 -05:00
Bubblegumdrop
6a8f90500f Fixed SDL_SwapBE16 issue on client side.
< Bubblegumdrop> SDLNet_UDP_Open seems to call SDLNet_Read16 (which is just SDL_SwapBE16)
< Bubblegumdrop> But on the server side I don't use SDLNet_UDP_Open to host the port
< whitt> probably the sender was flipping it but the receiver wasn't and so they were incompatible
< Bubblegumdrop> removing the SDL_SwapBE16 on the client side fixed it
2022-01-03 14:48:50 -05:00
Bubblegumdrop
46b2ed80ae Initial commit.
Another nuke! This time, trying to do a client <-> server thing.

Also a bit of messing with Lua.
2022-01-02 19:28:16 -05:00