facebook360_dep
Facebook360 Depth Estimation Pipeline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GlWindow Class Referenceabstract

A multi-window, OS independent opengl window. More...

#include <GlfwUtil.h>

Inheritance diagram for GlWindow:
GlOffscreenWindow GlViewer OffscreenWindow OffscreenWindow SimpleMeshWindow

Public Types

enum  ScreenState : unsigned { ON_SCREEN = 0x1, OFF_SCREEN = 0x2, BOTH_SCREEN = 0x3 }
 

Public Member Functions

 GlWindow ()
 Off-screen window constructor. More...
 
 GlWindow (const std::string &name, const int width, const int height, const bool borderless=false, const int outputBPP=8, const ScreenState screenState=ON_SCREEN)
 On-screen window constructor. More...
 
virtual ~GlWindow ()
 

Static Public Member Functions

static void mainLoop ()
 

Protected Member Functions

virtual void updateTransform ()
 
virtual void reshape (const int w, const int h)
 
virtual void mouse (const int button, const int action, const int mods)
 
virtual void motion (const double x, const double y)
 
virtual void keyPress (const int key, const int s, const int action, const int mods)
 
void resetTransformState ()
 
virtual void display ()=0
 

Protected Attributes

const ScreenState screenState
 
int mouseButton
 
int mouseAction
 
int mouseMods
 
Eigen::Vector2f mousePos
 
Eigen::Vector2i viewport
 
float scale
 
Eigen::Projective3f projection
 
Eigen::Affine3f transform = Eigen::Affine3f::Identity()
 
Eigen::Vector3f up
 
float pitch
 
float yaw
 
Eigen::Vector3f origin
 
bool wireframe
 
bool done
 
std::string name
 
int width
 
int height
 
GLFWwindow * window
 
GLuint fbo
 

Detailed Description

A multi-window, OS independent opengl window.

Copyright 2004-present Facebook. All Rights Reserved.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.

Abstracts the glfw window across multiple instances and factors out code common to all glfw windows into the base class.

The fundamental idea behind the window abstract is that the common cases should be simple and intuitive. In particular:

An instance with no arguments to the constructor creates an offscreen window. All on screen instances require a window name, width, and height.

These two are the most common cases so the idea is that we make it easy to create those. All the extra constructor arguments are designed for more complicated arrangements like borderless windows or windows that have both on and offscreen buffers.

Member Enumeration Documentation

◆ ScreenState

enum GlWindow::ScreenState : unsigned
Enumerator
ON_SCREEN 
OFF_SCREEN 
BOTH_SCREEN 

Constructor & Destructor Documentation

◆ GlWindow() [1/2]

GlWindow::GlWindow ( )
inline

Off-screen window constructor.

◆ GlWindow() [2/2]

GlWindow::GlWindow ( const std::string &  name,
const int  width,
const int  height,
const bool  borderless = false,
const int  outputBPP = 8,
const ScreenState  screenState = ON_SCREEN 
)
inline

On-screen window constructor.

Parameters
width
Windowname that appears in the border. required
height
Windowwidth in pixels. required
borderless
Windowheight in pixels. required
outputBPP
Enableborderless windows, default=false.
screenState
Bitsper pixel, default=8.
Enableoffscreen rendering or both. Default = ON_SCREEN

◆ ~GlWindow()

virtual GlWindow::~GlWindow ( )
inlinevirtual

Member Function Documentation

◆ display()

virtual void GlWindow::display ( )
protectedpure virtual

◆ keyPress()

virtual void GlWindow::keyPress ( const int  key,
const int  s,
const int  action,
const int  mods 
)
inlineprotectedvirtual

Reimplemented in SimpleMeshWindow, and GlViewer.

◆ mainLoop()

static void GlWindow::mainLoop ( )
inlinestatic

◆ motion()

virtual void GlWindow::motion ( const double  x,
const double  y 
)
inlineprotectedvirtual

◆ mouse()

virtual void GlWindow::mouse ( const int  button,
const int  action,
const int  mods 
)
inlineprotectedvirtual

◆ resetTransformState()

void GlWindow::resetTransformState ( )
inlineprotected

◆ reshape()

virtual void GlWindow::reshape ( const int  w,
const int  h 
)
inlineprotectedvirtual

◆ updateTransform()

virtual void GlWindow::updateTransform ( )
inlineprotectedvirtual

Member Data Documentation

◆ done

bool GlWindow::done
protected

◆ fbo

GLuint GlWindow::fbo
protected

◆ height

int GlWindow::height
protected

◆ mouseAction

int GlWindow::mouseAction
protected

◆ mouseButton

int GlWindow::mouseButton
protected

◆ mouseMods

int GlWindow::mouseMods
protected

◆ mousePos

Eigen::Vector2f GlWindow::mousePos
protected

◆ name

std::string GlWindow::name
protected

◆ origin

Eigen::Vector3f GlWindow::origin
protected

◆ pitch

float GlWindow::pitch
protected

◆ projection

Eigen::Projective3f GlWindow::projection
protected

◆ scale

float GlWindow::scale
protected

◆ screenState

const ScreenState GlWindow::screenState
protected

◆ transform

Eigen::Affine3f GlWindow::transform = Eigen::Affine3f::Identity()
protected

◆ up

Eigen::Vector3f GlWindow::up
protected

◆ viewport

Eigen::Vector2i GlWindow::viewport
protected

◆ width

int GlWindow::width
protected

◆ window

GLFWwindow* GlWindow::window
protected

◆ wireframe

bool GlWindow::wireframe
protected

◆ yaw

float GlWindow::yaw
protected

The documentation for this class was generated from the following files: