mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-14 20:18:14 +00:00
Compare commits
17 Commits
B1-rc5
...
Release/B1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
163a2e5d0a | ||
|
|
b979752989 | ||
|
|
8ad2d5f949 | ||
|
|
745ba66119 | ||
|
|
4cf6dec592 | ||
|
|
d7fa0aeff9 | ||
|
|
2def6346e6 | ||
|
|
607539a2af | ||
|
|
6d24dd52d6 | ||
|
|
e3343cbd01 | ||
|
|
71ffa0a137 | ||
|
|
2b4f8091f9 | ||
|
|
113da121e9 | ||
|
|
dd7413f973 | ||
|
|
0851fd13e6 | ||
|
|
97024041f3 | ||
|
|
22238c3200 |
@@ -14,6 +14,9 @@ if(OPTIMIZE_FOR_NATIVE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(ENABLE_BACKTRACE "Enable backtrace support on crash" ON)
|
||||||
|
add_feature_info(ENABLE_BACKTRACE ENABLE_BACKTRACE "Backtrace support.")
|
||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
"-Wall"
|
"-Wall"
|
||||||
"-Werror"
|
"-Werror"
|
||||||
|
|||||||
@@ -215,9 +215,8 @@ static bool dxgi_init(void * pointerShape, const unsigned int pointerSize)
|
|||||||
IDXGIAdapter1_GetDesc1(this->adapter, &adapterDesc);
|
IDXGIAdapter1_GetDesc1(this->adapter, &adapterDesc);
|
||||||
|
|
||||||
const size_t s = (wcslen(adapterDesc.Description)+1) * 2;
|
const size_t s = (wcslen(adapterDesc.Description)+1) * 2;
|
||||||
size_t unused;
|
|
||||||
char * desc = malloc(s);
|
char * desc = malloc(s);
|
||||||
wcstombs_s(&unused, desc, s, adapterDesc.Description, _TRUNCATE);
|
wcstombs(desc, adapterDesc.Description, s);
|
||||||
|
|
||||||
if (strstr(desc, optAdapter) == NULL)
|
if (strstr(desc, optAdapter) == NULL)
|
||||||
{
|
{
|
||||||
@@ -238,9 +237,8 @@ static bool dxgi_init(void * pointerShape, const unsigned int pointerSize)
|
|||||||
if (optOutput)
|
if (optOutput)
|
||||||
{
|
{
|
||||||
const size_t s = (wcslen(outputDesc.DeviceName)+1) * 2;
|
const size_t s = (wcslen(outputDesc.DeviceName)+1) * 2;
|
||||||
size_t unused;
|
|
||||||
char * desc = malloc(s);
|
char * desc = malloc(s);
|
||||||
wcstombs_s(&unused, desc, s, outputDesc.DeviceName, _TRUNCATE);
|
wcstombs(desc, outputDesc.DeviceName, s);
|
||||||
|
|
||||||
if (strstr(desc, optOutput) == NULL)
|
if (strstr(desc, optOutput) == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +1,4 @@
|
|||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
|
|
||||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "app.manifest"
|
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "app.manifest"
|
||||||
IDI_APPLICATION ICON "icon.ico"
|
IDI_APPLICATION ICON "../../../resources/icon.ico"
|
||||||
|
|||||||
@@ -194,9 +194,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
for(int i = 0; i < app.argc; ++i)
|
for(int i = 0; i < app.argc; ++i)
|
||||||
{
|
{
|
||||||
const size_t s = (wcslen(wargv[i])+1) * 2;
|
const size_t s = (wcslen(wargv[i])+1) * 2;
|
||||||
size_t unused;
|
|
||||||
app.argv[i] = malloc(s);
|
app.argv[i] = malloc(s);
|
||||||
wcstombs_s(&unused, app.argv[i], s, wargv[i], _TRUNCATE);
|
wcstombs(app.argv[i], wargv[i], s);
|
||||||
}
|
}
|
||||||
LocalFree(wargv);
|
LocalFree(wargv);
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ add_feature_info(ENABLE_EGL ENABLE_EGL "EGL renderer.")
|
|||||||
option(ENABLE_CB_X11 "Enable X11 clipboard integration" ON)
|
option(ENABLE_CB_X11 "Enable X11 clipboard integration" ON)
|
||||||
add_feature_info(ENABLE_CB_X11 ENABLE_CB_X11 "X11 Clipboard Integration.")
|
add_feature_info(ENABLE_CB_X11 ENABLE_CB_X11 "X11 Clipboard Integration.")
|
||||||
|
|
||||||
|
option(ENABLE_BACKTRACE "Enable backtrace support on crash" ON)
|
||||||
|
add_feature_info(ENABLE_BACKTRACE ENABLE_BACKTRACE "Backtrace support.")
|
||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
"-Wall"
|
"-Wall"
|
||||||
"-Werror"
|
"-Werror"
|
||||||
|
|||||||
@@ -48,6 +48,20 @@ Below are a list of current key bindings:
|
|||||||
| <kbd>ScrLk</kbd>+<kbd>N</kbd> | Toggle night vision mode (EGL renderer only!) |
|
| <kbd>ScrLk</kbd>+<kbd>N</kbd> | Toggle night vision mode (EGL renderer only!) |
|
||||||
| <kbd>ScrLk</kbd>+<kbd>Insert</kbd> | Increase mouse sensitivity (in capture mode only) |
|
| <kbd>ScrLk</kbd>+<kbd>Insert</kbd> | Increase mouse sensitivity (in capture mode only) |
|
||||||
| <kbd>ScrLk</kbd>+<kbd>Del</kbd> | Decrease mouse sensitivity (in capture mode only) |
|
| <kbd>ScrLk</kbd>+<kbd>Del</kbd> | Decrease mouse sensitivity (in capture mode only) |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F1</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F1</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F2</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F2</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F3</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F3</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F4</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F4</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F5</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F5</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F6</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F6</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F7</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F7</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F8</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F8</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F9</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F9</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F10</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F10</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F11</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F11</kbd> to the guest |
|
||||||
|
| <kbd>ScrLk</kbd>+<kbd>F12</kbd> | Send <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F12</kbd> to the guest |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Setting options via command line arguments
|
### Setting options via command line arguments
|
||||||
|
|
||||||
@@ -87,9 +101,9 @@ Command line arguments will override any options loaded from the config files.
|
|||||||
| app:framePollInterval | | 1000 | How often to check for a frame update in microseconds |
|
| app:framePollInterval | | 1000 | How often to check for a frame update in microseconds |
|
||||||
|-------------------------------------------------------------------------------------------------------------------------|
|
|-------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
|
||||||
|-------------------------------------------------------------------------------------------------------|
|
|-------------------------------------------------------------------------------------------------------------|
|
||||||
| Long | Short | Value | Description |
|
| Long | Short | Value | Description |
|
||||||
|-------------------------------------------------------------------------------------------------------|
|
|-------------------------------------------------------------------------------------------------------------|
|
||||||
| win:title | | Looking Glass (client) | The window title |
|
| win:title | | Looking Glass (client) | The window title |
|
||||||
| win:position | | center | Initial window position at startup |
|
| win:position | | center | Initial window position at startup |
|
||||||
| win:size | | 1024x768 | Initial window size at startup |
|
| win:size | | 1024x768 | Initial window size at startup |
|
||||||
@@ -99,12 +113,13 @@ Command line arguments will override any options loaded from the config files.
|
|||||||
| win:borderless | -d | no | Borderless mode |
|
| win:borderless | -d | no | Borderless mode |
|
||||||
| win:fullScreen | -F | no | Launch in fullscreen borderless mode |
|
| win:fullScreen | -F | no | Launch in fullscreen borderless mode |
|
||||||
| win:maximize | -T | no | Launch window maximized |
|
| win:maximize | -T | no | Launch window maximized |
|
||||||
|
| win:minimizeOnFocusLoss | | yes | Minimize window on focus loss |
|
||||||
| win:fpsLimit | -K | 200 | Frame rate limit (0 = disable - not recommended) |
|
| win:fpsLimit | -K | 200 | Frame rate limit (0 = disable - not recommended) |
|
||||||
| win:showFPS | -k | no | Enable the FPS & UPS display |
|
| win:showFPS | -k | no | Enable the FPS & UPS display |
|
||||||
| win:ignoreQuit | -Q | no | Ignore requests to quit (ie: Alt+F4) |
|
| win:ignoreQuit | -Q | no | Ignore requests to quit (ie: Alt+F4) |
|
||||||
| win:noScreensaver | -S | no | Prevent the screensaver from starting |
|
| win:noScreensaver | -S | no | Prevent the screensaver from starting |
|
||||||
| win:alerts | -q | yes | Show on screen alert messages |
|
| win:alerts | -q | yes | Show on screen alert messages |
|
||||||
|-------------------------------------------------------------------------------------------------------|
|
|-------------------------------------------------------------------------------------------------------------|
|
||||||
|
|
||||||
|---------------------------------------------------------------------------------------------------------------------------------------|
|
|---------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| Long | Short | Value | Description |
|
| Long | Short | Value | Description |
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ struct EGL_Desktop
|
|||||||
struct DesktopShader shader_yuv;
|
struct DesktopShader shader_yuv;
|
||||||
|
|
||||||
// internals
|
// internals
|
||||||
|
LG_Lock updateLock;
|
||||||
enum EGL_PixelFormat pixFmt;
|
enum EGL_PixelFormat pixFmt;
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
unsigned int pitch;
|
unsigned int pitch;
|
||||||
@@ -140,6 +141,8 @@ bool egl_desktop_init(EGL_Desktop ** desktop)
|
|||||||
egl_model_set_default((*desktop)->model);
|
egl_model_set_default((*desktop)->model);
|
||||||
egl_model_set_texture((*desktop)->model, (*desktop)->texture);
|
egl_model_set_texture((*desktop)->model, (*desktop)->texture);
|
||||||
|
|
||||||
|
LG_LOCK_INIT((*desktop)->updateLock);
|
||||||
|
|
||||||
(*desktop)->kbNV = app_register_keybind(SDL_SCANCODE_N, egl_desktop_toggle_nv, *desktop);
|
(*desktop)->kbNV = app_register_keybind(SDL_SCANCODE_N, egl_desktop_toggle_nv, *desktop);
|
||||||
|
|
||||||
(*desktop)->nvMax = option_get_int("egl", "nvGainMax");
|
(*desktop)->nvMax = option_get_int("egl", "nvGainMax");
|
||||||
@@ -165,6 +168,8 @@ void egl_desktop_free(EGL_Desktop ** desktop)
|
|||||||
if (!*desktop)
|
if (!*desktop)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
LG_LOCK_FREE((*desktop)->updateLock);
|
||||||
|
|
||||||
egl_texture_free(&(*desktop)->texture );
|
egl_texture_free(&(*desktop)->texture );
|
||||||
egl_shader_free (&(*desktop)->shader_generic.shader);
|
egl_shader_free (&(*desktop)->shader_generic.shader);
|
||||||
egl_shader_free (&(*desktop)->shader_yuv.shader );
|
egl_shader_free (&(*desktop)->shader_yuv.shader );
|
||||||
@@ -180,6 +185,7 @@ bool egl_desktop_prepare_update(EGL_Desktop * desktop, const bool sourceChanged,
|
|||||||
{
|
{
|
||||||
if (sourceChanged)
|
if (sourceChanged)
|
||||||
{
|
{
|
||||||
|
LG_LOCK(desktop->updateLock);
|
||||||
switch(format.type)
|
switch(format.type)
|
||||||
{
|
{
|
||||||
case FRAME_TYPE_BGRA:
|
case FRAME_TYPE_BGRA:
|
||||||
@@ -204,24 +210,30 @@ bool egl_desktop_prepare_update(EGL_Desktop * desktop, const bool sourceChanged,
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
DEBUG_ERROR("Unsupported frame format");
|
DEBUG_ERROR("Unsupported frame format");
|
||||||
|
LG_UNLOCK(desktop->updateLock);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
desktop->width = format.width;
|
desktop->width = format.width;
|
||||||
desktop->height = format.height;
|
desktop->height = format.height;
|
||||||
desktop->pitch = format.pitch;
|
desktop->pitch = format.pitch;
|
||||||
}
|
|
||||||
|
|
||||||
desktop->data = data;
|
desktop->data = data;
|
||||||
desktop->update = true;
|
desktop->update = true;
|
||||||
|
|
||||||
|
/* defer the actual update as the format has changed and we need to issue GL commands first */
|
||||||
|
LG_UNLOCK(desktop->updateLock);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool egl_desktop_perform_update(EGL_Desktop * desktop, const bool sourceChanged)
|
/* update the texture now */
|
||||||
|
return egl_texture_update(desktop->texture, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void egl_desktop_perform_update(EGL_Desktop * desktop, const bool sourceChanged)
|
||||||
{
|
{
|
||||||
if (sourceChanged)
|
if (sourceChanged)
|
||||||
{
|
{
|
||||||
|
LG_LOCK(desktop->updateLock);
|
||||||
if (!egl_texture_setup(
|
if (!egl_texture_setup(
|
||||||
desktop->texture,
|
desktop->texture,
|
||||||
desktop->pixFmt,
|
desktop->pixFmt,
|
||||||
@@ -232,27 +244,26 @@ bool egl_desktop_perform_update(EGL_Desktop * desktop, const bool sourceChanged)
|
|||||||
))
|
))
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("Failed to setup the desktop texture");
|
DEBUG_ERROR("Failed to setup the desktop texture");
|
||||||
return false;
|
LG_UNLOCK(desktop->updateLock);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
LG_UNLOCK(desktop->updateLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!desktop->update)
|
if (desktop->update)
|
||||||
return true;
|
|
||||||
|
|
||||||
if (!egl_texture_update(desktop->texture, desktop->data))
|
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("Failed to update the desktop texture");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
desktop->update = false;
|
desktop->update = false;
|
||||||
return true;
|
egl_texture_update(desktop->texture, desktop->data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, const float scaleX, const float scaleY, const bool nearest)
|
bool egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, const float scaleX, const float scaleY, const bool nearest)
|
||||||
{
|
{
|
||||||
if (!desktop->shader)
|
if (!desktop->shader)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
|
if (egl_texture_process(desktop->texture) != EGL_TEX_STATUS_OK)
|
||||||
|
return false;
|
||||||
|
|
||||||
const struct DesktopShader * shader = desktop->shader;
|
const struct DesktopShader * shader = desktop->shader;
|
||||||
egl_shader_use(shader->shader);
|
egl_shader_use(shader->shader);
|
||||||
@@ -269,4 +280,5 @@ void egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, con
|
|||||||
glUniform1i(shader->uNV, 0);
|
glUniform1i(shader->uNV, 0);
|
||||||
|
|
||||||
egl_model_render(desktop->model);
|
egl_model_render(desktop->model);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
@@ -29,5 +29,5 @@ bool egl_desktop_init(EGL_Desktop ** desktop);
|
|||||||
void egl_desktop_free(EGL_Desktop ** desktop);
|
void egl_desktop_free(EGL_Desktop ** desktop);
|
||||||
|
|
||||||
bool egl_desktop_prepare_update(EGL_Desktop * desktop, const bool sourceChanged, const LG_RendererFormat format, const uint8_t * data);
|
bool egl_desktop_prepare_update(EGL_Desktop * desktop, const bool sourceChanged, const LG_RendererFormat format, const uint8_t * data);
|
||||||
bool egl_desktop_perform_update(EGL_Desktop * desktop, const bool sourceChanged);
|
void egl_desktop_perform_update(EGL_Desktop * desktop, const bool sourceChanged);
|
||||||
void egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, const float scaleX, const float scaleY, const bool nearest);
|
bool egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, const float scaleX, const float scaleY, const bool nearest);
|
||||||
@@ -318,9 +318,6 @@ bool egl_on_frame_event(void * opaque, const LG_RendererFormat format, const uin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this->waitFadeTime)
|
|
||||||
this->waitFadeTime = microtime() + SPLASH_FADE_TIME;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,8 +490,12 @@ bool egl_render(void * opaque, SDL_Window * window)
|
|||||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
egl_desktop_render(this->desktop, this->translateX, this->translateY, this->scaleX, this->scaleY, this->useNearest);
|
if (egl_desktop_render(this->desktop, this->translateX, this->translateY, this->scaleX, this->scaleY, this->useNearest))
|
||||||
|
{
|
||||||
|
if (!this->waitFadeTime)
|
||||||
|
this->waitFadeTime = microtime() + SPLASH_FADE_TIME;
|
||||||
egl_cursor_render(this->cursor);
|
egl_cursor_render(this->cursor);
|
||||||
|
}
|
||||||
|
|
||||||
if (!this->waitDone)
|
if (!this->waitDone)
|
||||||
{
|
{
|
||||||
@@ -535,13 +536,9 @@ bool egl_render(void * opaque, SDL_Window * window)
|
|||||||
eglSwapBuffers(this->display, this->surface);
|
eglSwapBuffers(this->display, this->surface);
|
||||||
|
|
||||||
// defer texture uploads until after the flip to avoid stalling
|
// defer texture uploads until after the flip to avoid stalling
|
||||||
if (!egl_desktop_perform_update(this->desktop, this->sourceChanged))
|
egl_desktop_perform_update(this->desktop, this->sourceChanged);
|
||||||
{
|
|
||||||
DEBUG_ERROR("Failed to perform the desktop update");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this->sourceChanged = false;
|
|
||||||
|
|
||||||
|
this->sourceChanged = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ struct EGL_Texture
|
|||||||
enum EGL_PixelFormat pixFmt;
|
enum EGL_PixelFormat pixFmt;
|
||||||
size_t width, height;
|
size_t width, height;
|
||||||
bool streaming;
|
bool streaming;
|
||||||
|
bool ready;
|
||||||
|
|
||||||
int textureCount;
|
int textureCount;
|
||||||
GLuint textures[3];
|
GLuint textures[3];
|
||||||
@@ -44,10 +45,12 @@ struct EGL_Texture
|
|||||||
|
|
||||||
bool hasPBO;
|
bool hasPBO;
|
||||||
GLuint pbo[2];
|
GLuint pbo[2];
|
||||||
int pboIndex;
|
int pboRIndex;
|
||||||
bool needsUpdate;
|
int pboWIndex;
|
||||||
|
int pboCount;
|
||||||
size_t pboBufferSize;
|
size_t pboBufferSize;
|
||||||
void * pboMap[2];
|
void * pboMap[2];
|
||||||
|
GLsync pboSync[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
bool egl_texture_init(EGL_Texture ** texture)
|
bool egl_texture_init(EGL_Texture ** texture)
|
||||||
@@ -81,6 +84,9 @@ void egl_texture_free(EGL_Texture ** texture)
|
|||||||
{
|
{
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, (*texture)->pbo[i]);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, (*texture)->pbo[i]);
|
||||||
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||||
|
|
||||||
|
if ((*texture)->pboSync[i])
|
||||||
|
glDeleteSync((*texture)->pboSync[i]);
|
||||||
}
|
}
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
glDeleteBuffers(2, (*texture)->pbo);
|
glDeleteBuffers(2, (*texture)->pbo);
|
||||||
@@ -98,6 +104,7 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_
|
|||||||
texture->width = width;
|
texture->width = width;
|
||||||
texture->height = height;
|
texture->height = height;
|
||||||
texture->streaming = streaming;
|
texture->streaming = streaming;
|
||||||
|
texture->ready = false;
|
||||||
|
|
||||||
switch(pixFmt)
|
switch(pixFmt)
|
||||||
{
|
{
|
||||||
@@ -210,8 +217,7 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_
|
|||||||
texture->pboBufferSize,
|
texture->pboBufferSize,
|
||||||
NULL,
|
NULL,
|
||||||
GL_MAP_PERSISTENT_BIT |
|
GL_MAP_PERSISTENT_BIT |
|
||||||
GL_MAP_WRITE_BIT |
|
GL_MAP_WRITE_BIT
|
||||||
GL_MAP_COHERENT_BIT
|
|
||||||
);
|
);
|
||||||
|
|
||||||
texture->pboMap[i] = glMapBufferRange(
|
texture->pboMap[i] = glMapBufferRange(
|
||||||
@@ -221,7 +227,8 @@ bool egl_texture_setup(EGL_Texture * texture, enum EGL_PixelFormat pixFmt, size_
|
|||||||
GL_MAP_PERSISTENT_BIT |
|
GL_MAP_PERSISTENT_BIT |
|
||||||
GL_MAP_WRITE_BIT |
|
GL_MAP_WRITE_BIT |
|
||||||
GL_MAP_UNSYNCHRONIZED_BIT |
|
GL_MAP_UNSYNCHRONIZED_BIT |
|
||||||
GL_MAP_INVALIDATE_BUFFER_BIT
|
GL_MAP_INVALIDATE_BUFFER_BIT |
|
||||||
|
GL_MAP_FLUSH_EXPLICIT_BIT
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!texture->pboMap[i])
|
if (!texture->pboMap[i])
|
||||||
@@ -240,22 +247,23 @@ bool egl_texture_update(EGL_Texture * texture, const uint8_t * buffer)
|
|||||||
{
|
{
|
||||||
if (texture->streaming)
|
if (texture->streaming)
|
||||||
{
|
{
|
||||||
if (texture->needsUpdate)
|
/* NOTE: DO NOT use any gl commands here as streaming must be thread safe */
|
||||||
{
|
|
||||||
DEBUG_ERROR("Previous frame was not consumed");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (++texture->pboIndex == 2)
|
if (texture->pboCount == 2)
|
||||||
texture->pboIndex = 0;
|
return true;
|
||||||
|
|
||||||
/* update the GPU buffer */
|
/* update the GPU buffer */
|
||||||
memcpy(texture->pboMap[texture->pboIndex], buffer, texture->pboBufferSize);
|
memcpy(texture->pboMap[texture->pboWIndex], buffer, texture->pboBufferSize);
|
||||||
|
texture->pboSync[texture->pboWIndex] = 0;
|
||||||
|
|
||||||
texture->needsUpdate = true;
|
if (++texture->pboWIndex == 2)
|
||||||
|
texture->pboWIndex = 0;
|
||||||
|
++texture->pboCount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* Non streaming, this is NOT thread safe */
|
||||||
|
|
||||||
for(int i = 0; i < texture->textureCount; ++i)
|
for(int i = 0; i < texture->textureCount; ++i)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, texture->textures[i]);
|
glBindTexture(GL_TEXTURE_2D, texture->textures[i]);
|
||||||
@@ -268,11 +276,53 @@ bool egl_texture_update(EGL_Texture * texture, const uint8_t * buffer)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void egl_texture_bind(EGL_Texture * texture)
|
enum EGL_TexStatus egl_texture_process(EGL_Texture * texture)
|
||||||
{
|
{
|
||||||
if (texture->streaming && texture->needsUpdate)
|
if (!texture->streaming)
|
||||||
|
return EGL_TEX_STATUS_OK;
|
||||||
|
|
||||||
|
if (texture->pboCount == 0)
|
||||||
|
return texture->ready ? EGL_TEX_STATUS_OK : EGL_TEX_STATUS_NOTREADY;
|
||||||
|
|
||||||
|
/* process any buffers that have not yet been flushed */
|
||||||
|
int pos = texture->pboRIndex;
|
||||||
|
for(int i = 0; i < texture->pboCount; ++i)
|
||||||
{
|
{
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[texture->pboIndex]);
|
if (texture->pboSync[pos] == 0)
|
||||||
|
{
|
||||||
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[pos]);
|
||||||
|
glFlushMappedBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, texture->pboBufferSize);
|
||||||
|
texture->pboSync[pos] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (++pos == 2)
|
||||||
|
pos = 0;
|
||||||
|
}
|
||||||
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
|
|
||||||
|
/* wait for the buffer to be ready */
|
||||||
|
pos = texture->pboRIndex;
|
||||||
|
switch(glClientWaitSync(texture->pboSync[pos], GL_SYNC_FLUSH_COMMANDS_BIT, 0))
|
||||||
|
{
|
||||||
|
case GL_ALREADY_SIGNALED:
|
||||||
|
case GL_CONDITION_SATISFIED:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GL_TIMEOUT_EXPIRED:
|
||||||
|
return texture->ready ? EGL_TEX_STATUS_OK : EGL_TEX_STATUS_NOTREADY;
|
||||||
|
|
||||||
|
case GL_WAIT_FAILED:
|
||||||
|
glDeleteSync(texture->pboSync[pos]);
|
||||||
|
DEBUG_ERROR("glClientWaitSync failed");
|
||||||
|
return EGL_TEX_STATUS_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* delete the sync and bind the buffer */
|
||||||
|
glDeleteSync(texture->pboSync[pos]);
|
||||||
|
texture->pboSync[pos] = 0;
|
||||||
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, texture->pbo[pos]);
|
||||||
|
|
||||||
|
/* update the textures */
|
||||||
for(int i = 0; i < texture->textureCount; ++i)
|
for(int i = 0; i < texture->textureCount; ++i)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, texture->textures[i]);
|
glBindTexture(GL_TEXTURE_2D, texture->textures[i]);
|
||||||
@@ -283,15 +333,30 @@ void egl_texture_bind(EGL_Texture * texture)
|
|||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
texture->needsUpdate = false;
|
/* advance the read index */
|
||||||
|
if (++texture->pboRIndex == 2)
|
||||||
|
texture->pboRIndex = 0;
|
||||||
|
--texture->pboCount;
|
||||||
|
|
||||||
|
texture->ready = true;
|
||||||
|
|
||||||
|
return EGL_TEX_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EGL_TexStatus egl_texture_bind(EGL_Texture * texture)
|
||||||
|
{
|
||||||
|
/* if there are no new buffers ready, then just bind the textures */
|
||||||
|
if (texture->streaming && !texture->ready)
|
||||||
|
return EGL_TEX_STATUS_NOTREADY;
|
||||||
|
|
||||||
for(int i = 0; i < texture->textureCount; ++i)
|
for(int i = 0; i < texture->textureCount; ++i)
|
||||||
{
|
{
|
||||||
glActiveTexture(GL_TEXTURE0 + i);
|
glActiveTexture(GL_TEXTURE0 + i);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture->textures[i]);
|
glBindTexture(GL_TEXTURE_2D, texture->textures[i]);
|
||||||
glBindSampler(i, texture->samplers[i]);
|
glBindSampler(i, texture->samplers[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return EGL_TEX_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int egl_texture_count(EGL_Texture * texture)
|
int egl_texture_count(EGL_Texture * texture)
|
||||||
|
|||||||
@@ -34,10 +34,18 @@ enum EGL_PixelFormat
|
|||||||
EGL_PF_YUV420
|
EGL_PF_YUV420
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum EGL_TexStatus
|
||||||
|
{
|
||||||
|
EGL_TEX_STATUS_NOTREADY,
|
||||||
|
EGL_TEX_STATUS_OK,
|
||||||
|
EGL_TEX_STATUS_ERROR
|
||||||
|
};
|
||||||
|
|
||||||
bool egl_texture_init(EGL_Texture ** tex);
|
bool egl_texture_init(EGL_Texture ** tex);
|
||||||
void egl_texture_free(EGL_Texture ** tex);
|
void egl_texture_free(EGL_Texture ** tex);
|
||||||
|
|
||||||
bool egl_texture_setup (EGL_Texture * texture, enum EGL_PixelFormat pixfmt, size_t width, size_t height, size_t stride, bool streaming);
|
bool egl_texture_setup (EGL_Texture * texture, enum EGL_PixelFormat pixfmt, size_t width, size_t height, size_t stride, bool streaming);
|
||||||
bool egl_texture_update (EGL_Texture * texture, const uint8_t * buffer);
|
bool egl_texture_update (EGL_Texture * texture, const uint8_t * buffer);
|
||||||
void egl_texture_bind (EGL_Texture * texture);
|
enum EGL_TexStatus egl_texture_process(EGL_Texture * texture);
|
||||||
|
enum EGL_TexStatus egl_texture_bind (EGL_Texture * texture);
|
||||||
int egl_texture_count (EGL_Texture * texture);
|
int egl_texture_count (EGL_Texture * texture);
|
||||||
@@ -1 +0,0 @@
|
|||||||
.
|
|
||||||
@@ -17,7 +17,7 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|||||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "spice.h"
|
#include "spice/spice.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ KeybindHandle app_register_keybind(SDL_Scancode key, SuperEventFn callback, void
|
|||||||
|
|
||||||
void app_release_keybind(KeybindHandle * handle)
|
void app_release_keybind(KeybindHandle * handle)
|
||||||
{
|
{
|
||||||
if (!handle)
|
if (!*handle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
state.bindings[(*handle)->key] = NULL;
|
state.bindings[(*handle)->key] = NULL;
|
||||||
|
|||||||
@@ -175,13 +175,20 @@ static struct Option options[] =
|
|||||||
.type = OPTION_TYPE_BOOL,
|
.type = OPTION_TYPE_BOOL,
|
||||||
.value.x_bool = false,
|
.value.x_bool = false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.module = "win",
|
||||||
|
.name = "minimizeOnFocusLoss",
|
||||||
|
.description = "Minimize window on focus loss",
|
||||||
|
.type = OPTION_TYPE_BOOL,
|
||||||
|
.value.x_bool = true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.module = "win",
|
.module = "win",
|
||||||
.name = "fpsLimit",
|
.name = "fpsLimit",
|
||||||
.description = "Frame rate limit (0 = disable - not recommended)",
|
.description = "Frame rate limit (0 = disable - not recommended, -1 = auto detect)",
|
||||||
.shortopt = 'K',
|
.shortopt = 'K',
|
||||||
.type = OPTION_TYPE_INT,
|
.type = OPTION_TYPE_INT,
|
||||||
.value.x_int = 200,
|
.value.x_int = -1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.module = "win",
|
.module = "win",
|
||||||
@@ -396,6 +403,8 @@ bool config_load(int argc, char * argv[])
|
|||||||
params.hideMouse = option_get_bool ("input", "hideCursor" );
|
params.hideMouse = option_get_bool ("input", "hideCursor" );
|
||||||
params.mouseSens = option_get_int ("input", "mouseSens" );
|
params.mouseSens = option_get_int ("input", "mouseSens" );
|
||||||
|
|
||||||
|
params.minimizeOnFocusLoss = option_get_bool("win", "minimizeOnFocusLoss");
|
||||||
|
|
||||||
if (option_get_bool("spice", "enable"))
|
if (option_get_bool("spice", "enable"))
|
||||||
{
|
{
|
||||||
params.spiceHost = option_get_string("spice", "host");
|
params.spiceHost = option_get_string("spice", "host");
|
||||||
|
|||||||
@@ -947,18 +947,48 @@ static void mouse_sens_dec(SDL_Scancode key, void * opaque)
|
|||||||
free(msg);
|
free(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ctrl_alt_fn(SDL_Scancode key, void * opaque)
|
||||||
|
{
|
||||||
|
const uint32_t ctrl = mapScancode(SDL_SCANCODE_LCTRL);
|
||||||
|
const uint32_t alt = mapScancode(SDL_SCANCODE_LALT );
|
||||||
|
const uint32_t fn = mapScancode(key);
|
||||||
|
|
||||||
|
spice_key_down(ctrl);
|
||||||
|
spice_key_down(alt );
|
||||||
|
spice_key_down(fn );
|
||||||
|
|
||||||
|
spice_key_up(ctrl);
|
||||||
|
spice_key_up(alt );
|
||||||
|
spice_key_up(fn );
|
||||||
|
}
|
||||||
|
|
||||||
static void register_key_binds()
|
static void register_key_binds()
|
||||||
{
|
{
|
||||||
state.kbFS = app_register_keybind(SDL_SCANCODE_F , toggle_fullscreen, NULL);
|
state.kbFS = app_register_keybind(SDL_SCANCODE_F , toggle_fullscreen, NULL);
|
||||||
state.kbInput = app_register_keybind(SDL_SCANCODE_I , toggle_input , NULL);
|
state.kbInput = app_register_keybind(SDL_SCANCODE_I , toggle_input , NULL);
|
||||||
state.kbMouseSensInc = app_register_keybind(SDL_SCANCODE_INSERT, mouse_sens_inc , NULL);
|
state.kbMouseSensInc = app_register_keybind(SDL_SCANCODE_INSERT, mouse_sens_inc , NULL);
|
||||||
state.kbMouseSensDec = app_register_keybind(SDL_SCANCODE_DELETE, mouse_sens_dec , NULL);
|
state.kbMouseSensDec = app_register_keybind(SDL_SCANCODE_DELETE, mouse_sens_dec , NULL);
|
||||||
|
|
||||||
|
state.kbCtrlAltFn[0 ] = app_register_keybind(SDL_SCANCODE_F1 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[1 ] = app_register_keybind(SDL_SCANCODE_F2 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[2 ] = app_register_keybind(SDL_SCANCODE_F3 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[3 ] = app_register_keybind(SDL_SCANCODE_F4 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[4 ] = app_register_keybind(SDL_SCANCODE_F5 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[5 ] = app_register_keybind(SDL_SCANCODE_F6 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[6 ] = app_register_keybind(SDL_SCANCODE_F7 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[7 ] = app_register_keybind(SDL_SCANCODE_F8 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[8 ] = app_register_keybind(SDL_SCANCODE_F9 , ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[9 ] = app_register_keybind(SDL_SCANCODE_F10, ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[10] = app_register_keybind(SDL_SCANCODE_F11, ctrl_alt_fn, NULL);
|
||||||
|
state.kbCtrlAltFn[11] = app_register_keybind(SDL_SCANCODE_F12, ctrl_alt_fn, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void release_key_binds()
|
static void release_key_binds()
|
||||||
{
|
{
|
||||||
app_release_keybind(&state.kbFS);
|
app_release_keybind(&state.kbFS);
|
||||||
app_release_keybind(&state.kbInput);
|
app_release_keybind(&state.kbInput);
|
||||||
|
for(int i = 0; i < 12; ++i)
|
||||||
|
app_release_keybind(&state.kbCtrlAltFn[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int run()
|
int run()
|
||||||
@@ -970,7 +1000,6 @@ int run()
|
|||||||
state.running = true;
|
state.running = true;
|
||||||
state.scaleX = 1.0f;
|
state.scaleX = 1.0f;
|
||||||
state.scaleY = 1.0f;
|
state.scaleY = 1.0f;
|
||||||
state.frameTime = 1e9 / params.fpsLimit;
|
|
||||||
|
|
||||||
state.mouseSens = params.mouseSens;
|
state.mouseSens = params.mouseSens;
|
||||||
if (state.mouseSens < -9) state.mouseSens = -9;
|
if (state.mouseSens < -9) state.mouseSens = -9;
|
||||||
@@ -984,6 +1013,8 @@ int run()
|
|||||||
if (strcmp(XDG_SESSION_TYPE, "wayland") == 0)
|
if (strcmp(XDG_SESSION_TYPE, "wayland") == 0)
|
||||||
{
|
{
|
||||||
DEBUG_INFO("Wayland detected");
|
DEBUG_INFO("Wayland detected");
|
||||||
|
if (getenv("SDL_VIDEODRIVER") == NULL)
|
||||||
|
{
|
||||||
int err = setenv("SDL_VIDEODRIVER", "wayland", 1);
|
int err = setenv("SDL_VIDEODRIVER", "wayland", 1);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
{
|
{
|
||||||
@@ -992,6 +1023,7 @@ int run()
|
|||||||
}
|
}
|
||||||
DEBUG_INFO("SDL_VIDEODRIVER has been set to wayland");
|
DEBUG_INFO("SDL_VIDEODRIVER has been set to wayland");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// warn about using FPS display until we can fix the font rendering to prevent lag spikes
|
// warn about using FPS display until we can fix the font rendering to prevent lag spikes
|
||||||
if (params.showFPS)
|
if (params.showFPS)
|
||||||
@@ -1069,11 +1101,14 @@ int run()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.fullscreen)
|
if (params.fullscreen || !params.minimizeOnFocusLoss)
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
||||||
|
|
||||||
if (!params.noScreensaver)
|
if (!params.noScreensaver)
|
||||||
|
{
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
|
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
|
||||||
|
SDL_EnableScreenSaver();
|
||||||
|
}
|
||||||
|
|
||||||
if (!params.center)
|
if (!params.center)
|
||||||
SDL_SetWindowPosition(state.window, params.x, params.y);
|
SDL_SetWindowPosition(state.window, params.x, params.y);
|
||||||
@@ -1084,6 +1119,26 @@ int run()
|
|||||||
// ensure renderer viewport is aware of the current window size
|
// ensure renderer viewport is aware of the current window size
|
||||||
updatePositionInfo();
|
updatePositionInfo();
|
||||||
|
|
||||||
|
//Auto detect active monitor refresh rate for FPS Limit if no FPS Limit was passed.
|
||||||
|
if (params.fpsLimit == -1)
|
||||||
|
{
|
||||||
|
SDL_DisplayMode current;
|
||||||
|
if (SDL_GetCurrentDisplayMode(SDL_GetWindowDisplayIndex(state.window), ¤t) == 0)
|
||||||
|
{
|
||||||
|
state.frameTime = 1e9 / (current.refresh_rate * 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DEBUG_WARN("Unable to capture monitor refresh rate using the default FPS Limit: 200");
|
||||||
|
state.frameTime = 1e9 / 200;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DEBUG_INFO("Using the FPS Limit from args: %d", params.fpsLimit);
|
||||||
|
state.frameTime = 1e9 / params.fpsLimit;
|
||||||
|
}
|
||||||
|
|
||||||
register_key_binds();
|
register_key_binds();
|
||||||
|
|
||||||
// set the compositor hint to bypass for low latency
|
// set the compositor hint to bypass for low latency
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ struct AppState
|
|||||||
KeybindHandle kbInput;
|
KeybindHandle kbInput;
|
||||||
KeybindHandle kbMouseSensInc;
|
KeybindHandle kbMouseSensInc;
|
||||||
KeybindHandle kbMouseSensDec;
|
KeybindHandle kbMouseSensDec;
|
||||||
|
KeybindHandle kbCtrlAltFn[12];
|
||||||
|
|
||||||
int mouseSens;
|
int mouseSens;
|
||||||
float sensX, sensY;
|
float sensX, sensY;
|
||||||
@@ -81,6 +82,7 @@ struct AppParams
|
|||||||
bool borderless;
|
bool borderless;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool maximize;
|
bool maximize;
|
||||||
|
bool minimizeOnFocusLoss;
|
||||||
bool center;
|
bool center;
|
||||||
int x, y;
|
int x, y;
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ include_directories(
|
|||||||
${PROJECT_SOURCE_DIR}/include
|
${PROJECT_SOURCE_DIR}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_BACKTRACE)
|
||||||
|
add_definitions(-DENABLE_BACKTRACE)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(COMMON_SOURCES
|
set(COMMON_SOURCES
|
||||||
src/stringutils.c
|
src/stringutils.c
|
||||||
src/stringlist.c
|
src/stringlist.c
|
||||||
@@ -27,8 +31,10 @@ if(WIN32)
|
|||||||
else()
|
else()
|
||||||
set(SOURCES ${COMMON_SOURCES} ${LINUX_SOURCES})
|
set(SOURCES ${COMMON_SOURCES} ${LINUX_SOURCES})
|
||||||
add_library(lg_common STATIC ${SOURCES})
|
add_library(lg_common STATIC ${SOURCES})
|
||||||
|
if(ENABLE_BACKTRACE)
|
||||||
target_link_libraries(lg_common bfd)
|
target_link_libraries(lg_common bfd)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(lg_common
|
target_include_directories(lg_common
|
||||||
INTERFACE
|
INTERFACE
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "common/crash.h"
|
#include "common/crash.h"
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
|
|
||||||
|
#if defined(ENABLE_BACKTRACE)
|
||||||
|
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -220,3 +222,12 @@ bool installCrashHandler(const char * exe)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else //ENABLE_BACKTRACE
|
||||||
|
|
||||||
|
bool installCrashHandler(const char * exe)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
obj-m += kvmfr.o
|
obj-m += kvmfr.o
|
||||||
USER := $(shell whoami)
|
USER := $(shell whoami)
|
||||||
|
KVER ?= $(shell uname -r)
|
||||||
|
KDIR ?= /lib/modules/$(KVER)/build
|
||||||
|
|
||||||
all:
|
all:
|
||||||
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules
|
make -C $(KDIR) M=$(PWD) modules
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean
|
make -C $(KDIR) M=$(PWD) clean
|
||||||
|
|
||||||
test: all
|
test: all
|
||||||
grep -q '^uio' /proc/modules || sudo modprobe uio
|
grep -q '^uio' /proc/modules || sudo modprobe uio
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
PACKAGE_NAME=kvmfr
|
PACKAGE_NAME="kvmfr"
|
||||||
PACKAGE_VERSION=0.1
|
PACKAGE_VERSION="0.0.1"
|
||||||
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
|
BUILT_MODULE_NAME[0]="${PACKAGE_NAME}"
|
||||||
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
|
MAKE[0]="make KDIR=${kernel_source_dir}"
|
||||||
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
|
CLEAN="make KDIR=${kernel_source_dir} clean"
|
||||||
DEST_MODULE_LOCATION[0]=/extra
|
DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
|
||||||
REMAKE_INITRD=yes
|
AUTOINSTALL="yes"
|
||||||
AUTOINSTALL=yes
|
|
||||||
|
|||||||
BIN
resources/icon-128x128.png
Normal file
BIN
resources/icon-128x128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
resources/icon.ico
Normal file
BIN
resources/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
Reference in New Issue
Block a user