-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Framebuffer class, remove RenderTexture
- Loading branch information
Lauren Budorick
committed
Dec 2, 2017
1 parent
722ae7c
commit a541fae
Showing
15 changed files
with
155 additions
and
107 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
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,23 @@ | ||
// @flow | ||
const State = require('./state'); | ||
const { ColorAttachment, DepthAttachment } = require('./value'); | ||
|
||
import type Context from './context'; | ||
|
||
class Framebuffer { | ||
context: Context; | ||
framebuffer: WebGLFramebuffer; | ||
colorAttachment: State<?WebGLTexture>; | ||
depthAttachment: State<?WebGLRenderbuffer>; | ||
|
||
constructor(context: Context) { | ||
this.context = context; | ||
const gl = context.gl; | ||
const fbo = this.framebuffer = gl.createFramebuffer(); | ||
|
||
this.colorAttachment = new State(new ColorAttachment(context, fbo)); | ||
this.depthAttachment = new State(new DepthAttachment(context, fbo)); | ||
} | ||
} | ||
|
||
module.exports = Framebuffer; |
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
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
Oops, something went wrong.