mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] moved sdl and window init outside of the thread, needs to happen early
This commit is contained in:
parent
3173564b4d
commit
b5ef81ff57
@ -241,30 +241,6 @@ int renderThread(void * unused)
|
||||
format.stride = 0;
|
||||
format.frames = 0;
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0)
|
||||
{
|
||||
DEBUG_ERROR("SDL_Init Failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
state.window = SDL_CreateWindow("KVM-GFX Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 100, 100, SDL_WINDOW_BORDERLESS);
|
||||
if (!state.window)
|
||||
{
|
||||
DEBUG_ERROR("failed to create window");
|
||||
return -1;
|
||||
}
|
||||
|
||||
state.renderer = SDL_CreateRenderer(state.window, -1,
|
||||
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
||||
|
||||
if (!state.renderer)
|
||||
{
|
||||
DEBUG_ERROR("failed to create window");
|
||||
return -1;
|
||||
}
|
||||
|
||||
startCopyThreads();
|
||||
|
||||
while(state.running)
|
||||
{
|
||||
// ensure the header magic is valid, this will help prevent crash out when the memory hasn't yet been initialized
|
||||
@ -547,6 +523,31 @@ int main(int argc, char * argv[])
|
||||
memset(&state, 0, sizeof(state));
|
||||
state.running = true;
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0)
|
||||
{
|
||||
DEBUG_ERROR("SDL_Init Failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
state.window = SDL_CreateWindow("KVM-GFX Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 100, 100, SDL_WINDOW_BORDERLESS);
|
||||
if (!state.window)
|
||||
{
|
||||
DEBUG_ERROR("failed to create window");
|
||||
return -1;
|
||||
}
|
||||
|
||||
state.renderer = SDL_CreateRenderer(state.window, -1,
|
||||
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
||||
|
||||
if (!state.renderer)
|
||||
{
|
||||
DEBUG_ERROR("failed to create window");
|
||||
return -1;
|
||||
}
|
||||
|
||||
startCopyThreads();
|
||||
|
||||
|
||||
int shm_fd = 0;
|
||||
SDL_Thread *t_ivshmem = NULL;
|
||||
SDL_Thread *t_spice = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user