mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-09 22:03:58 +00:00
[client] added mipmapping support
This commit is contained in:
parent
f6bc62647f
commit
5a9688cd47
1 changed files with 30 additions and 8 deletions
|
@ -62,6 +62,7 @@ struct AppParams
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
const char * ivshmemSocket;
|
const char * ivshmemSocket;
|
||||||
bool useBufferStorage;
|
bool useBufferStorage;
|
||||||
|
bool useMipmap;
|
||||||
bool useSpice;
|
bool useSpice;
|
||||||
const char * spiceHost;
|
const char * spiceHost;
|
||||||
unsigned int spicePort;
|
unsigned int spicePort;
|
||||||
|
@ -79,6 +80,7 @@ struct AppParams params =
|
||||||
.h = 768,
|
.h = 768,
|
||||||
.ivshmemSocket = "/tmp/ivshmem_socket",
|
.ivshmemSocket = "/tmp/ivshmem_socket",
|
||||||
.useBufferStorage = true,
|
.useBufferStorage = true,
|
||||||
|
.useMipmap = false,
|
||||||
.useSpice = true,
|
.useSpice = true,
|
||||||
.spiceHost = "127.0.0.1",
|
.spiceHost = "127.0.0.1",
|
||||||
.spicePort = 5900
|
.spicePort = 5900
|
||||||
|
@ -254,8 +256,17 @@ int renderThread(void * unused)
|
||||||
glBindTexture(GL_TEXTURE_2D, vboTex);
|
glBindTexture(GL_TEXTURE_2D, vboTex);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S , GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S , GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T , GL_CLAMP_TO_EDGE);
|
||||||
|
if (params.useMipmap)
|
||||||
|
{
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
}
|
||||||
|
|
||||||
glTexImage2D(
|
glTexImage2D(
|
||||||
GL_TEXTURE_2D,
|
GL_TEXTURE_2D,
|
||||||
0,
|
0,
|
||||||
|
@ -314,6 +325,9 @@ int renderThread(void * unused)
|
||||||
GL_UNSIGNED_BYTE,
|
GL_UNSIGNED_BYTE,
|
||||||
(void*)0
|
(void*)0
|
||||||
);
|
);
|
||||||
|
if (params.useMipmap)
|
||||||
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
|
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
|
|
||||||
// draw the screen
|
// draw the screen
|
||||||
|
@ -730,12 +744,16 @@ void doHelp(char * app)
|
||||||
"Example: %s -h\n"
|
"Example: %s -h\n"
|
||||||
"\n"
|
"\n"
|
||||||
" -h Print out this help\n"
|
" -h Print out this help\n"
|
||||||
|
"\n"
|
||||||
" -f PATH Specify the path to the ivshmem socket [current: %s]\n"
|
" -f PATH Specify the path to the ivshmem socket [current: %s]\n"
|
||||||
" -g Disable OpenGL 4.3 Buffer Storage (GL_ARB_buffer_storage)\n"
|
"\n"
|
||||||
" -s Disable spice client\n"
|
" -s Disable spice client\n"
|
||||||
" -c HOST Specify the spice host [current: %s]\n"
|
" -c HOST Specify the spice host [current: %s]\n"
|
||||||
" -p PORT Specify the spice port [current: %d]\n"
|
" -p PORT Specify the spice port [current: %d]\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" -g Disable OpenGL 4.3 Buffer Storage (GL_ARB_buffer_storage)\n"
|
||||||
|
" -m Enable mipmapping (improves a stretched screen)\n"
|
||||||
|
"\n"
|
||||||
" -a Auto resize the window to the guest\n"
|
" -a Auto resize the window to the guest\n"
|
||||||
" -d Borderless mode\n"
|
" -d Borderless mode\n"
|
||||||
" -x XPOS Initial window X position [current: %s]\n"
|
" -x XPOS Initial window X position [current: %s]\n"
|
||||||
|
@ -783,7 +801,7 @@ void doLicense()
|
||||||
int main(int argc, char * argv[])
|
int main(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
while((c = getopt(argc, argv, "hf:gsc:p:adx:y:w:b:l")) != -1)
|
while((c = getopt(argc, argv, "hf:sc:p:gmadx:y:w:b:l")) != -1)
|
||||||
switch(c)
|
switch(c)
|
||||||
{
|
{
|
||||||
case '?':
|
case '?':
|
||||||
|
@ -796,10 +814,6 @@ int main(int argc, char * argv[])
|
||||||
params.ivshmemSocket = optarg;
|
params.ivshmemSocket = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'g':
|
|
||||||
params.useBufferStorage = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
params.useSpice = false;
|
params.useSpice = false;
|
||||||
break;
|
break;
|
||||||
|
@ -812,6 +826,14 @@ int main(int argc, char * argv[])
|
||||||
params.spicePort = atoi(optarg);
|
params.spicePort = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'g':
|
||||||
|
params.useBufferStorage = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'm':
|
||||||
|
params.useMipmap = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'a':
|
case 'a':
|
||||||
params.autoResize = true;
|
params.autoResize = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue