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
@ -239,31 +239,7 @@ int renderThread(void * unused)
|
|||||||
format.width = 0;
|
format.width = 0;
|
||||||
format.height = 0;
|
format.height = 0;
|
||||||
format.stride = 0;
|
format.stride = 0;
|
||||||
format.frames = 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)
|
while(state.running)
|
||||||
{
|
{
|
||||||
@ -547,6 +523,31 @@ int main(int argc, char * argv[])
|
|||||||
memset(&state, 0, sizeof(state));
|
memset(&state, 0, sizeof(state));
|
||||||
state.running = true;
|
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;
|
int shm_fd = 0;
|
||||||
SDL_Thread *t_ivshmem = NULL;
|
SDL_Thread *t_ivshmem = NULL;
|
||||||
SDL_Thread *t_spice = NULL;
|
SDL_Thread *t_spice = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user