Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ While high performance playback cannot be guaranteed, these minimum system requi
| Component | Recommended Minimum |
| --- | --- |
| CPU | 64-bit, 6 cores, 12 logical processors |
| GPU | OpenGL support |
| Memory (RAM) | 16 GB |
| Memory (GPU) | 8 GB |
| Storage | RAID or nvme |
Expand Down
5 changes: 5 additions & 0 deletions src/bin/apps/rv/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,11 @@ int utf8Main(int argc, char* argv[])
TwkGLF::FBOVideoDevice* dummyDev = new TwkGLF::FBOVideoDevice(0, 10, 10, false);
IPCore::ImageRenderer::queryGL();
const char* glVersion = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
if (!glVersion)
{
cout << "ERROR: no GPU available: GL_SHADING_LANGUAGE_VERSION query failed" << endl;
exit(-1);
}
IPCore::Shader::Function::useShadingLanguageVersion(glVersion);
#endif

Expand Down
5 changes: 5 additions & 0 deletions src/bin/imgtools/rvio/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,11 @@ int utf8Main(int argc, char* argv[])
#endif
IPCore::ImageRenderer::queryGL();
const char* glVersion = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
if (!glVersion)
{
cout << "ERROR: no GPU available: GL_SHADING_LANGUAGE_VERSION query failed" << endl;
exit(-1);
}
IPCore::Shader::Function::useShadingLanguageVersion(glVersion);

#ifndef PLATFORM_WINDOWS
Expand Down
32 changes: 30 additions & 2 deletions src/lib/graphics/TwkGLFFBO/FBOVideoDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <TwkGLF/GL.h>
#include <TwkGLF/GLFBO.h>
#include <TwkExc/Exception.h>
#include <cstdlib>
#include <iostream>

#ifdef PLATFORM_LINUX
Expand Down Expand Up @@ -154,9 +155,22 @@ namespace TwkGLF
int attrs[] = {GLX_BUFFER_SIZE, 32, GLX_RGBA, 0, GLX_STENCIL_SIZE, 1};

m_imp->display = XOpenDisplay(0);
if (!m_imp->display)
{
cout << "ERROR: no GPU available: could not open X display" << endl;
exit(-1);
}

m_imp->root = DefaultRootWindow(m_imp->display);
m_imp->vis = glXChooseVisual(m_imp->display, DefaultScreen(m_imp->display), attrs);

if (!m_imp->vis)
{
cout << "ERROR: no GPU available: no matching GLX visual"
<< endl;
exit(-1);
}

swa.colormap = XCreateColormap(m_imp->display, m_imp->root, m_imp->vis->visual, AllocNone);

swa.event_mask = ExposureMask | KeyPressMask;
Expand All @@ -166,6 +180,12 @@ namespace TwkGLF

m_imp->ctx = glXCreateContext(m_imp->display, m_imp->vis, 0, True);

if (!m_imp->ctx)
{
cout << "ERROR: no GPU available: could not create GLX context" << endl;
exit(-1);
}

glXMakeCurrent(m_imp->display, m_imp->tiny, m_imp->ctx);
#endif

Expand Down Expand Up @@ -241,10 +261,18 @@ namespace TwkGLF
SetPixelFormat(m_imp->deviceContext, result, &m_imp->format);

m_imp->glContext = wglCreateContext(m_imp->deviceContext);
assert(m_imp->glContext != NULL);
if (!m_imp->glContext)
{
cout << "ERROR: no GPU available: could not create WGL context" << endl;
exit(-1);
}

wglMakeCurrent(m_imp->deviceContext, m_imp->glContext);
assert(wglGetCurrentContext() != NULL);
if (!wglGetCurrentContext())
{
cout << "ERROR: no GPU available: could not activate WGL context" << endl;
exit(-1);
}
glewInit(NULL);
#endif

Expand Down