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 <X11/Xlib.h>
20#include <GL/gl.h>
21#include <GL/glx.h>
22#include <GL/glxext.h>
23
24namespace o2::gpu
25{
27{
28 public:
30 ~GPUDisplayFrontendX11() override = default;
31
32 void SwitchFullscreen(bool set) override;
33 void ToggleMaximized(bool set) override;
34 void SetVSync(bool enable) override;
35 void OpenGLPrint(const char* s, float x, float y, float r, float g, float b, float a, bool fromBotton = true) override;
36 void getSize(int32_t& width, int32_t& height) override;
37 float getDisplayScale() const override { return mScale; }
38 int32_t getVulkanSurface(void* instance, void* surface) override;
39 uint32_t getReqVulkanExtensions(const char**& p) override;
40
41 private:
42 int32_t FrontendMain() override;
43 int32_t GetKey(int32_t key);
44 void GetKey(XEvent& event, int32_t& keyOut, int32_t& keyPressOut);
45
46 GLuint mFontBase;
47
48 Display* mXDisplay = nullptr;
49 Window mWindow;
50 void updateWindowState();
51 float mScale = 1.f; // From the Xft.dpi X resource (desktop scaling, e.g. KDE with "Apply scaling themselves" for X11 apps)
52
53 PFNGLXSWAPINTERVALEXTPROC mGlXSwapIntervalEXT = nullptr;
54 bool vsync_supported = false;
55 bool canSetVSync() override { return vsync_supported && mGlXSwapIntervalEXT; }
56};
57} // namespace o2::gpu
58
59#endif
const Acts::Surface * surface
StringRef key
~GPUDisplayFrontendX11() override=default
void getSize(int32_t &width, int32_t &height) override
int32_t getVulkanSurface(void *instance, void *surface) override
float getDisplayScale() const 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
GLint y
Definition glcorearb.h:270
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