Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 926ada64d1b9
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9d6dad93d582
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Sep 5, 2020

  1. Copy the full SHA
    9d6dad9 View commit details
Showing with 67 additions and 10 deletions.
  1. +66 −9 src/glscopeclient/WaveformArea.cpp
  2. +1 −1 src/glscopeclient/shaders/waveform-compute.glsl
75 changes: 66 additions & 9 deletions src/glscopeclient/WaveformArea.cpp
Original file line number Diff line number Diff line change
@@ -479,29 +479,86 @@ void WaveformArea::on_realize()
Gtk::GLArea::on_realize();
make_current();

// Initialize GLEW
//Set up GLEW
if(!m_isGlewInitialized)
{
GLenum glewResult = glewInit();
//Check if GL was initialized OK
if(has_error())
{
//doesn't seem to be any way to get this error without throwing it??
try
{
throw_if_error();
}
catch(Glib::Error& gerr)
{
string err =
"glscopeclient was unable to initialize OpenGL and cannot continue.\n"
"This probably indicates a problem with your graphics card drivers.\n"
"\n"
"GL error: ";
err += gerr.what();

Gtk::MessageDialog dlg(
err,
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK,
true
);

dlg.run();
exit(1);
}
}

string err =
"glscopeclient was unable to initialize GLEW and cannot continue.\n"
"This probably indicates a problem with your graphics card drivers.\n"
"\n"
"GLEW error: ";
err += (const char*)glewGetErrorString(glewResult);
//Print some debug info
auto context = get_context();
if(!context)
LogFatal("context is null but we don't have an error set in GTK\n");
int major, minor;
context->get_version(major, minor);
string profile = "compatibility";
if(context->is_legacy())
profile = "legacy";
else if(context->get_forward_compatible())
profile = "core";
string type = "";
if(context->get_use_es())
type = " ES";
LogDebug("Context: OpenGL%s %d.%d %s profile\n",
type.c_str(),
major, minor,
profile.c_str());
{
LogIndenter li;
LogDebug("GL_VENDOR = %s\n", glGetString(GL_VENDOR));
LogDebug("GL_RENDERER = %s\n", glGetString(GL_RENDERER));
LogDebug("GL_VERSION = %s\n", glGetString(GL_VERSION));
LogDebug("GL_SHADING_LANGUAGE_VERSION = %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
LogDebug("Initial GL error code: %d\n", glGetError());
}

//Initialize GLEW
GLenum glewResult = glewInit();
if (glewResult != GLEW_OK)
{
string err =
"glscopeclient was unable to initialize GLEW and cannot continue.\n"
"This probably indicates a problem with your graphics card drivers.\n"
"\n"
"GLEW error: ";
err += (const char*)glewGetErrorString(glewResult);

Gtk::MessageDialog dlg(
err,
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK,
true
);
dlg.run();

dlg.run();
exit(1);
}

2 changes: 1 addition & 1 deletion src/glscopeclient/shaders/waveform-compute.glsl
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ void main()
//Digital signal - do not interpolate
else
{
//Draw the vertical line exactly one sample wide at edges
//TODO: Draw the vertical line exactly one sample wide at edges
}

//Clip to window size