How to stream is covered here
But it’s really not worth integrating streaming into your game client, it’s not “useful” to many streamers. As otherwise you need to implemented everything Xsplit/OBS does, such as:
- Local Recording
- Ability to include Webcam
- Ability to include scenes
- Ability to include overlays and other browser source content
- Ability to pick target injest
- Ability to select bandwidth/quality
Sure you could proably take the SLOBS route (a client onto of OBS core), but then you still need to build the client with the extras.
Basically, the requirements of including this into your game potentially out weigh the gains.