-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ f046fb8 🚀
- Loading branch information
Showing
10 changed files
with
87 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <vtkObjectFactory.h> | ||
#include <vtkOpenGLFramebufferObject.h> | ||
#include <vtkOpenGLState.h> | ||
|
||
#include "vtkF3DExternalRenderWindow.h" | ||
|
||
vtkStandardNewMacro(vtkF3DExternalRenderWindow); | ||
|
||
//------------------------------------------------------------------------------ | ||
vtkF3DExternalRenderWindow::vtkF3DExternalRenderWindow() | ||
{ | ||
this->FrameBlitMode = BlitToCurrent; | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
vtkF3DExternalRenderWindow::~vtkF3DExternalRenderWindow() = default; | ||
|
||
//------------------------------------------------------------------------------ | ||
void vtkF3DExternalRenderWindow::Start() | ||
{ | ||
// creates or resizes the framebuffer | ||
this->Size[0] = (this->Size[0] > 0 ? this->Size[0] : 300); | ||
this->Size[1] = (this->Size[1] > 0 ? this->Size[1] : 300); | ||
this->CreateFramebuffers(this->Size[0], this->Size[1]); | ||
|
||
this->GetState()->PushFramebufferBindings(); | ||
|
||
this->BlitToRenderFramebuffer(true); | ||
this->RenderFramebuffer->Bind(); | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
void vtkF3DExternalRenderWindow::Render() | ||
{ | ||
if (!this->Initialized) | ||
{ | ||
// skip vtkGenericOpenGLRenderWindow because it calls OpenGL before it's even initialized | ||
this->vtkOpenGLRenderWindow::OpenGLInit(); | ||
} | ||
|
||
this->Superclass::Render(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* @class vtkF3DExternalRenderWindow | ||
* @brief external context render window | ||
*/ | ||
|
||
#ifndef vtkF3DExternalRenderWindow_h | ||
#define vtkF3DExternalRenderWindow_h | ||
|
||
#include "vtkGenericOpenGLRenderWindow.h" | ||
|
||
class vtkF3DExternalRenderWindow : public vtkGenericOpenGLRenderWindow | ||
{ | ||
public: | ||
static vtkF3DExternalRenderWindow* New(); | ||
vtkTypeMacro(vtkF3DExternalRenderWindow, vtkGenericOpenGLRenderWindow); | ||
|
||
/** | ||
* Begin the rendering process using the existing context. | ||
*/ | ||
void Start() override; | ||
|
||
/** | ||
* An external context is always considered current. | ||
*/ | ||
bool IsCurrent() override { return true; } | ||
|
||
/** | ||
* Trigger rendering. Reimplemented to ensure OpenGL is initialized. | ||
*/ | ||
void Render() override; | ||
|
||
protected: | ||
vtkF3DExternalRenderWindow(); | ||
~vtkF3DExternalRenderWindow() override; | ||
|
||
private: | ||
vtkF3DExternalRenderWindow(const vtkF3DExternalRenderWindow&) = delete; | ||
void operator=(const vtkF3DExternalRenderWindow&) = delete; | ||
}; | ||
#endif // vtkF3DExternalRenderWindow_h |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.