Project
Loading...
Searching...
No Matches
GPUDisplayFrontendGlut.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 GPUDISPLAYFRONTENDGLUT_H
16#define GPUDISPLAYFRONTENDGLUT_H
17
18#include "GPUDisplayFrontend.h"
19#include <pthread.h>
20
21namespace o2::gpu
22{
24{
25 public:
27 ~GPUDisplayFrontendGlut() override = default;
28
29 int32_t StartDisplay() override;
30 void DisplayExit() override;
31 void SwitchFullscreen(bool set) override;
32 void ToggleMaximized(bool set) override;
33 void SetVSync(bool enable) override;
34 void OpenGLPrint(const char* s, float x, float y, float r, float g, float b, float a, bool fromBotton = true) override;
35
36 private:
37 int32_t FrontendMain() override;
38
39 static void displayFunc();
40 static void glutLoopFunc();
41 static void keyboardUpFunc(uint8_t key, int32_t x, int32_t y);
42 static void keyboardDownFunc(uint8_t key, int32_t x, int32_t y);
43 static void specialUpFunc(int32_t key, int32_t x, int32_t y);
44 static void specialDownFunc(int32_t key, int32_t x, int32_t y);
45 static void mouseMoveFunc(int32_t x, int32_t y);
46 static void mMouseWheelFunc(int32_t button, int32_t dir, int32_t x, int32_t y);
47 static void mouseFunc(int32_t button, int32_t state, int32_t x, int32_t y);
48 static void ResizeSceneWrapper(int32_t width, int32_t height);
49 static int32_t GetKey(int32_t key);
50 static void GetKey(int32_t keyin, int32_t& keyOut, int32_t& keyPressOut, bool special);
51
52 volatile bool mGlutRunning = false;
53 pthread_mutex_t mSemLockExit = PTHREAD_MUTEX_INITIALIZER;
54
55 int32_t mWidth = INIT_WIDTH;
56 int32_t mHeight = INIT_HEIGHT;
57 bool mFullScreen = false;
58};
59} // namespace o2::gpu
60
61#endif
benchmark::State & state
StringRef key
~GPUDisplayFrontendGlut() override=default
void OpenGLPrint(const char *s, float x, float y, float r, float g, float b, float a, bool fromBotton=true) override
static constexpr int32_t INIT_WIDTH
static constexpr int32_t INIT_HEIGHT
GLint GLenum GLint x
Definition glcorearb.h:403
GLint GLsizei GLsizei height
Definition glcorearb.h:270
GLint GLsizei width
Definition glcorearb.h:270
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