Project
Loading...
Searching...
No Matches
GPUDisplayFrontendX11.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUDISPLAYFRONTENDX11_H
16#define GPUDISPLAYFRONTENDX11_H
17
18#include "GPUDisplayFrontend.h"
19#include <GL/glx.h>
20#include <pthread.h>
21#include <unistd.h>
22#include <GL/glxext.h>
23
24namespace o2::gpu
25{
27{
28 public:
30 ~GPUDisplayFrontendX11() override = default;
31
32 int32_t StartDisplay() override;
33 void DisplayExit() override;
34 void SwitchFullscreen(bool set) override;
35 void ToggleMaximized(bool set) override;
36 void SetVSync(bool enable) override;
37 void OpenGLPrint(const char* s, float x, float y, float r, float g, float b, float a, bool fromBotton = true) override;
38 void getSize(int32_t& width, int32_t& height) override;
39 int32_t getVulkanSurface(void* instance, void* surface) override;
40 uint32_t getReqVulkanExtensions(const char**& p) override;
41
42 private:
43 int32_t FrontendMain() override;
44 int32_t GetKey(int32_t key);
45 void GetKey(XEvent& event, int32_t& keyOut, int32_t& keyPressOut);
46
47 pthread_mutex_t mSemLockExit = PTHREAD_MUTEX_INITIALIZER;
48 volatile bool mDisplayRunning = false;
49
50 GLuint mFontBase;
51
52 Display* mDisplay = nullptr;
53 Window mWindow;
54
55 PFNGLXSWAPINTERVALEXTPROC mGlXSwapIntervalEXT = nullptr;
56 bool vsync_supported = false;
57};
58} // namespace o2::gpu
59
60#endif
StringRef key
~GPUDisplayFrontendX11() override=default
void getSize(int32_t &width, int32_t &height) override
int32_t getVulkanSurface(void *instance, void *surface) override
void OpenGLPrint(const char *s, float x, float y, float r, float g, float b, float a, bool fromBotton=true) override
uint32_t getReqVulkanExtensions(const char **&p) override
void SetVSync(bool enable) override
struct _cl_event * event
Definition glcorearb.h:2982
GLint GLenum GLint x
Definition glcorearb.h:403
GLint GLsizei GLsizei height
Definition glcorearb.h:270
GLint GLsizei width
Definition glcorearb.h:270
unsigned int GLuint
Definition glcorearb.h:88
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean g
Definition glcorearb.h:1233
GLboolean enable
Definition glcorearb.h:3991
GLboolean r
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
HANDLE pthread_mutex_t