Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libvisual: Improve lv-tool a bit #151

Merged
merged 6 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libvisual/examples/simple/simple_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ LV::VideoPtr SimpleExample::create_display (int width, int height, VisVideoDepth
m_sdl_screen = nullptr;

if (depth == VISUAL_VIDEO_DEPTH_GL) {
int flags = SDL_OPENGL | SDL_GL_DOUBLEBUFFER | SDL_RESIZABLE;
int flags = SDL_OPENGL | SDL_RESIZABLE;

SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 8);
Expand Down
1 change: 1 addition & 0 deletions libvisual/libvisual/lv_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ static void print_cpu_info (void)
#endif /* VISUAL_ARCH_X86 || VISUAL_ARCH_X86_64 */
}

__attribute__((no_sanitize("address")))
void visual_cpu_initialize ()
{
visual_mem_set (&cpu_caps, 0, sizeof (VisCPU));
Expand Down
9 changes: 3 additions & 6 deletions libvisual/tools/lv-tool/display/sdl_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,10 @@ namespace {
return nullptr;
}

videoflags |= SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
videoflags |= SDL_OPENGL;

if (videoinfo->hw_available)
videoflags |= SDL_HWSURFACE;
else
videoflags |= SDL_SWSURFACE;

if (videoinfo->blit_hw)
videoflags |= SDL_HWACCEL;

if (vidoptions) {
for (unsigned int i = VISUAL_GL_ATTRIBUTE_NONE; i < VISUAL_GL_ATTRIBUTE_LAST; i++) {
Expand All @@ -130,6 +125,8 @@ namespace {
}
}

SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);

int bpp = videoinfo->vfmt->BitsPerPixel;
m_screen = SDL_SetVideoMode (width, height, bpp, videoflags);

Expand Down
9 changes: 3 additions & 6 deletions libvisual/tools/lv-tool/display/stdout_sdl_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,10 @@ namespace {
return nullptr;
}

videoflags |= SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
videoflags |= SDL_OPENGL;

if (videoinfo->hw_available)
videoflags |= SDL_HWSURFACE;
else
videoflags |= SDL_SWSURFACE;

if (videoinfo->blit_hw)
videoflags |= SDL_HWACCEL;

if (vidoptions) {
for (unsigned int i = VISUAL_GL_ATTRIBUTE_NONE; i < VISUAL_GL_ATTRIBUTE_LAST; i++) {
Expand All @@ -144,6 +139,8 @@ namespace {
}
}

SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);

bpp = videoinfo->vfmt->BitsPerPixel;

unsigned int buffer_size = width * height * 3;
Expand Down
9 changes: 7 additions & 2 deletions libvisual/tools/lv-tool/lv-tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Authors: Daniel Hiepler <daniel@niftylight.de>
// Chong Kai Xiong <kaixiong@codeleft.sg>
// Dennis Smit <ds@nerds-incorporated.org>
// Scott Sibley <sisibley@gmail.com>
//
// This file is part of lv-tool.
//
Expand Down Expand Up @@ -38,12 +39,16 @@
#include <getopt.h>

// Defaults
#define DEFAULT_ACTOR "lv_analyzer"
#ifdef HAVE_GL
# define DEFAULT_ACTOR "lv_gltest"
#else
# define DEFAULT_ACTOR "lv_analyzer"
#endif
#define DEFAULT_INPUT "debug"
#define DEFAULT_MORPH "slide_left"
#define DEFAULT_WIDTH 320
#define DEFAULT_HEIGHT 200
#define DEFAULT_FPS 30
#define DEFAULT_FPS 60
#define DEFAULT_COLOR_DEPTH 0

#if HAVE_SDL
Expand Down