Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

remove c++ implementation (see c++ branch)

  • Loading branch information...
commit f6d78dbffd371a66ca3e2319b49e8921ee082298 1 parent 7bc78af
Elijah Insua authored August 24, 2011

Showing 49 changed files with 2 additions and 2,275 deletions. Show diff stats Hide diff stats

  1. 24  include/WebGL.h
  2. 19  src/Event.cc
  3. 24  src/Event.h
  4. 19  src/ImageData.cc
  5. 24  src/ImageData.h
  6. 5  src/SConstruct
  7. 31  src/WebGLActiveInfo.cc
  8. 27  src/WebGLActiveInfo.h
  9. 19  src/WebGLBuffer.cc
  10. 24  src/WebGLBuffer.h
  11. 19  src/WebGLContextAttributes.cc
  12. 29  src/WebGLContextAttributes.h
  13. 27  src/WebGLContextEvent.cc
  14. 27  src/WebGLContextEvent.h
  15. 19  src/WebGLFramebuffer.cc
  16. 24  src/WebGLFramebuffer.h
  17. 19  src/WebGLObject.cc
  18. 24  src/WebGLObject.h
  19. 51  src/WebGLProgram.cc
  20. 32  src/WebGLProgram.h
  21. 19  src/WebGLRenderbuffer.cc
  22. 24  src/WebGLRenderbuffer.h
  23. 703  src/WebGLRenderingContext.cc
  24. 505  src/WebGLRenderingContext.h
  25. 41  src/WebGLShader.cc
  26. 27  src/WebGLShader.h
  27. 19  src/WebGLTexture.cc
  28. 24  src/WebGLTexture.h
  29. 19  src/WebGLUniformLocation.cc
  30. 24  src/WebGLUniformLocation.h
  31. 18  src/dom/DOMString.cc
  32. 25  src/dom/DOMString.h
  33. 19  src/dom/HTMLCanvasElement.cc
  34. 24  src/dom/HTMLCanvasElement.h
  35. 19  src/dom/HTMLImageElement.cc
  36. 24  src/dom/HTMLImageElement.h
  37. 19  src/dom/HTMLVideoElement.cc
  38. 24  src/dom/HTMLVideoElement.h
  39. 19  src/typedarray/ArrayBuffer.cc
  40. 28  src/typedarray/ArrayBuffer.h
  41. 19  src/typedarray/ArrayBufferView.cc
  42. 24  src/typedarray/ArrayBufferView.h
  43. 29  src/typedarray/FloatArray.cc
  44. 32  src/typedarray/FloatArray.h
  45. 19  src/typedarray/Int32Array.cc
  46. 24  src/typedarray/Int32Array.h
  47. 0  src/typedarray/base.h
  48. 13  src/util.cc
  49. 6  src/util.h
24  include/WebGL.h
... ...
@@ -1,28 +1,4 @@
1 1
 #ifndef _WEBGL_INCLUDE_GAURD_
2 2
 #define _WEBGL_INCLUDE_GAURD_
3 3
   #include "../src/arch/wrapper.h"
4  
-  #include "../src/dom/DOMString.h"
5  
-  #include "../src/dom/HTMLCanvasElement.h"
6  
-  #include "../src/dom/HTMLImageElement.h"
7  
-  #include "../src/dom/HTMLVideoElement.h"
8  
-  #include "../src/Event.h"
9  
-  #include "../src/ImageData.h"
10  
-  #include "../src/typedarray/ArrayBuffer.h"
11  
-  #include "../src/typedarray/ArrayBufferView.h"
12  
-  #include "../src/typedarray/base.h"
13  
-  #include "../src/typedarray/FloatArray.h"
14  
-  #include "../src/typedarray/Int32Array.h"
15  
-  #include "../src/util.h"
16  
-  #include "../src/WebGLActiveInfo.h"
17  
-  #include "../src/WebGLBuffer.h"
18  
-  #include "../src/WebGLContextAttributes.h"
19  
-  #include "../src/WebGLContextEvent.h"
20  
-  #include "../src/WebGLFramebuffer.h"
21  
-  #include "../src/WebGLObject.h"
22  
-  #include "../src/WebGLProgram.h"
23  
-  #include "../src/WebGLRenderbuffer.h"
24  
-  #include "../src/WebGLRenderingContext.h"
25  
-  #include "../src/WebGLShader.h"
26  
-  #include "../src/WebGLTexture.h"
27  
-  #include "../src/WebGLUniformLocation.h"
28 4
 #endif
19  src/Event.cc
... ...
@@ -1,19 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  Event.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "Event.h"
11  
-
12  
-Event::Event() {
13  
-  
14  
-}
15  
-
16  
-Event::~Event() {
17  
-  
18  
-}
19  
-
24  src/Event.h
... ...
@@ -1,24 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  Event.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_Event_
10  
-#define _INCLUDED_Event_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-
15  
-
16  
-
17  
-class Event {
18  
-  public:
19  
-
20  
-    Event();
21  
-    ~Event();
22  
-};
23  
-
24  
-#endif
19  src/ImageData.cc
... ...
@@ -1,19 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  ImageData.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "ImageData.h"
11  
-
12  
-ImageData::ImageData() {
13  
-  
14  
-}
15  
-
16  
-ImageData::~ImageData() {
17  
-  
18  
-}
19  
-
24  src/ImageData.h
... ...
@@ -1,24 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  ImageData.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_ImageData_
10  
-#define _INCLUDED_ImageData_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-
15  
-
16  
-
17  
-class ImageData {
18  
-  public:
19  
-
20  
-    ImageData();
21  
-    ~ImageData();
22  
-};
23  
-
24  
-#endif
5  src/SConstruct
@@ -9,10 +9,9 @@ env = Environment(
9 9
   FRAMEWORKS=['OpenGL', 'GLUT']
10 10
   )
11 11
 
12  
-sources = Glob('*.cc')
  12
+sources = Glob('arch/*.cc')
13 13
 sources.extend(Glob('js/*.cc'))
14  
-sources.extend(Glob('dom/*.cc'))
15  
-#sources.extend(Glob('typedarray/*.cc'))
  14
+
16 15
 
17 16
 env.StaticLibrary('WebGL', sources)
18 17
 
31  src/WebGLActiveInfo.cc
... ...
@@ -1,31 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLActiveInfo.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLActiveInfo.h"
11  
-
12  
-WebGLActiveInfo::WebGLActiveInfo() {
13  
-  
14  
-}
15  
-
16  
-WebGLActiveInfo::~WebGLActiveInfo() {
17  
-  
18  
-}
19  
-
20  
-GLint WebGLActiveInfo::getSize() {
21  
-  
22  
-}
23  
-
24  
-GLenum WebGLActiveInfo::getType() {
25  
-  
26  
-}
27  
-
28  
-DOMString WebGLActiveInfo::getName() {
29  
-  
30  
-}
31  
-
27  src/WebGLActiveInfo.h
... ...
@@ -1,27 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLActiveInfo.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLActiveInfo_
10  
-#define _INCLUDED_WebGLActiveInfo_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-#include "dom/DOMString.h"
15  
-
16  
-
17  
-class WebGLActiveInfo {
18  
-  public:
19  
-    GLint getSize();
20  
-    GLenum getType();
21  
-    DOMString getName();
22  
-
23  
-    WebGLActiveInfo();
24  
-    ~WebGLActiveInfo();
25  
-};
26  
-
27  
-#endif
19  src/WebGLBuffer.cc
... ...
@@ -1,19 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLBuffer.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLBuffer.h"
11  
-
12  
-WebGLBuffer::WebGLBuffer() {
13  
-  glGenBuffers(1, &this->id);
14  
-}
15  
-
16  
-WebGLBuffer::~WebGLBuffer() {
17  
-  
18  
-}
19  
-
24  src/WebGLBuffer.h
... ...
@@ -1,24 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLBuffer.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLBuffer_
10  
-#define _INCLUDED_WebGLBuffer_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-#include "WebGLObject.h"
15  
-
16  
-
17  
-class WebGLBuffer : WebGLObject {
18  
-  public:
19  
-    GLuint id;
20  
-    WebGLBuffer();
21  
-    ~WebGLBuffer();
22  
-};
23  
-
24  
-#endif
19  src/WebGLContextAttributes.cc
... ...
@@ -1,19 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLContextAttributes.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLContextAttributes.h"
11  
-
12  
-WebGLContextAttributes::WebGLContextAttributes() {
13  
-  
14  
-}
15  
-
16  
-WebGLContextAttributes::~WebGLContextAttributes() {
17  
-  
18  
-}
19  
-
29  src/WebGLContextAttributes.h
... ...
@@ -1,29 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLContextAttributes.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLContextAttributes_
10  
-#define _INCLUDED_WebGLContextAttributes_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-
15  
-
16  
-
17  
-class WebGLContextAttributes {
18  
-  public:
19  
-    bool alpha;
20  
-    bool depth;
21  
-    bool stencil;
22  
-    bool antialias;
23  
-    bool premultipliedAlpha;
24  
-
25  
-    WebGLContextAttributes();
26  
-    ~WebGLContextAttributes();
27  
-};
28  
-
29  
-#endif
27  src/WebGLContextEvent.cc
... ...
@@ -1,27 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLContextEvent.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLContextEvent.h"
11  
-
12  
-WebGLContextEvent::WebGLContextEvent() {
13  
-  
14  
-}
15  
-
16  
-WebGLContextEvent::~WebGLContextEvent() {
17  
-  
18  
-}
19  
-
20  
-DOMString WebGLContextEvent::getStatusMessage() {
21  
-  
22  
-}
23  
-
24  
-void WebGLContextEvent::initWebGLContextEvent(DOMString *typeArg, bool canBubbleArg, bool cancelableArg, DOMString *statusMessageArg) {
25  
-  
26  
-}
27  
-
27  src/WebGLContextEvent.h
... ...
@@ -1,27 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLContextEvent.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLContextEvent_
10  
-#define _INCLUDED_WebGLContextEvent_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-#include "Event.h"
15  
-#include "dom/DOMString.h"
16  
-
17  
-
18  
-class WebGLContextEvent : Event {
19  
-  public:
20  
-    DOMString getStatusMessage();
21  
-    void initWebGLContextEvent(DOMString *typeArg, bool canBubbleArg, bool cancelableArg, DOMString *statusMessageArg);
22  
-
23  
-    WebGLContextEvent();
24  
-    ~WebGLContextEvent();
25  
-};
26  
-
27  
-#endif
19  src/WebGLFramebuffer.cc
... ...
@@ -1,19 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLFramebuffer.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLFramebuffer.h"
11  
-
12  
-WebGLFramebuffer::WebGLFramebuffer() {
13  
-  
14  
-}
15  
-
16  
-WebGLFramebuffer::~WebGLFramebuffer() {
17  
-  
18  
-}
19  
-
24  src/WebGLFramebuffer.h
... ...
@@ -1,24 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLFramebuffer.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLFramebuffer_
10  
-#define _INCLUDED_WebGLFramebuffer_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-#include "WebGLObject.h"
15  
-
16  
-
17  
-class WebGLFramebuffer : WebGLObject {
18  
-  public:
19  
-    GLuint id;
20  
-    WebGLFramebuffer();
21  
-    ~WebGLFramebuffer();
22  
-};
23  
-
24  
-#endif
19  src/WebGLObject.cc
... ...
@@ -1,19 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLObject.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLObject.h"
11  
-
12  
-WebGLObject::WebGLObject() {
13  
-  
14  
-}
15  
-
16  
-WebGLObject::~WebGLObject() {
17  
-  
18  
-}
19  
-
24  src/WebGLObject.h
... ...
@@ -1,24 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLObject.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLObject_
10  
-#define _INCLUDED_WebGLObject_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-
15  
-
16  
-
17  
-class WebGLObject {
18  
-  public:
19  
-
20  
-    WebGLObject();
21  
-    ~WebGLObject();
22  
-};
23  
-
24  
-#endif
51  src/WebGLProgram.cc
... ...
@@ -1,51 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLProgram.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLProgram.h"
11  
-
12  
-WebGLProgram::WebGLProgram() {
13  
-  this->id = glCreateProgram();
14  
-  this->linked = false;
15  
-}
16  
-
17  
-WebGLProgram::~WebGLProgram() {
18  
-  glDeleteProgram(this->id);
19  
-}
20  
-
21  
-void WebGLProgram::link() {
22  
-  glLinkProgram(this->id);
23  
-
24  
-  GLint linked;
25  
-  glGetProgramiv(this->id, GL_LINK_STATUS, &linked);
26  
-
27  
-  if (!linked) {
28  
-    this->linked = false;
29  
-  } else {
30  
-    this->linked = true;
31  
-  }
32  
-}
33  
-
34  
-bool WebGLProgram::status(GLenum type) {
35  
-  switch (type) {
36  
-    case GL_LINK_STATUS:
37  
-      return this->linked;
38  
-    break;
39  
-  }
40  
-}
41  
-
42  
-void WebGLProgram::attach(WebGLShader *shader) {
43  
-  glAttachShader(this->id, shader->id);
44  
-}
45  
-
46  
-void WebGLProgram::use() {
47  
-  // TODO: toss an error here
48  
-  if (this->linked) {
49  
-    glUseProgram(this->id);
50  
-  }
51  
-}
32  src/WebGLProgram.h
... ...
@@ -1,32 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLProgram.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLProgram_
10  
-#define _INCLUDED_WebGLProgram_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-#include "WebGLObject.h"
15  
-#include "WebGLShader.h"
16  
-
17  
-
18  
-class WebGLProgram : WebGLObject {
19  
-  public:
20  
-    GLuint id;
21  
-    WebGLProgram();
22  
-    ~WebGLProgram();
23  
-    
24  
-    void link();
25  
-    bool status(GLenum type);
26  
-    void use();
27  
-    void attach(WebGLShader *shader);
28  
-  protected:
29  
-    bool linked;
30  
-};
31  
-
32  
-#endif
19  src/WebGLRenderbuffer.cc
... ...
@@ -1,19 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-  
4  
-  WebGLRenderbuffer.h
5  
-  
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLRenderbuffer.h"
11  
-
12  
-WebGLRenderbuffer::WebGLRenderbuffer() {
13  
-  
14  
-}
15  
-
16  
-WebGLRenderbuffer::~WebGLRenderbuffer() {
17  
-  
18  
-}
19  
-
24  src/WebGLRenderbuffer.h
... ...
@@ -1,24 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLRenderbuffer.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-#ifndef _INCLUDED_WebGLRenderbuffer_
10  
-#define _INCLUDED_WebGLRenderbuffer_
11  
-
12  
-#include "arch/wrapper.h"
13  
-
14  
-#include "WebGLObject.h"
15  
-
16  
-
17  
-class WebGLRenderbuffer : WebGLObject {
18  
-  public:
19  
-    GLuint id;
20  
-    WebGLRenderbuffer();
21  
-    ~WebGLRenderbuffer();
22  
-};
23  
-
24  
-#endif
703  src/WebGLRenderingContext.cc
... ...
@@ -1,703 +0,0 @@
1  
-/**
2  
-  WebGL Standalone
3  
-
4  
-  WebGLRenderingContext.h
5  
-
6  
-  Released under the MIT license (see: ../LICENSE)
7  
-  Copyright Elijah Insua <tmpvar@gmail.com> 2011
8  
-**/
9  
-
10  
-#include "WebGLRenderingContext.h"
11  
-
12  
-WebGLRenderingContext::WebGLRenderingContext() {
13  
-
14  
-}
15  
-
16  
-WebGLRenderingContext::~WebGLRenderingContext() {
17  
-
18  
-}
19  
-
20  
-HTMLCanvasElement WebGLRenderingContext::getCanvas() {
21  
-
22  
-}
23  
-
24  
-WebGLContextAttributes* WebGLRenderingContext::getContextAttributes() {
25  
-
26  
-}
27  
-
28  
-
29  
-bool WebGLRenderingContext::isContextLost() {
30  
-  return false;
31  
-}
32  
-
33  
-
34  
-DOMString** WebGLRenderingContext::getSupportedExtensions() {
35  
-
36  
-}
37  
-
38  
-
39  
-void* WebGLRenderingContext::getExtension(DOMString *name) {
40  
-
41  
-}
42  
-
43  
-void WebGLRenderingContext::activeTexture(GLenum texture) {
44  
-
45  
-}
46  
-
47  
-void WebGLRenderingContext::attachShader(WebGLProgram *program, WebGLShader *shader) {
48  
-  assert(program);
49  
-  assert(shader);
50  
-  program->attach(shader);
51  
-}
52  
-
53  
-void WebGLRenderingContext::bindAttribLocation(WebGLProgram *program, GLuint index, DOMString *name) {
54  
-  glBindAttribLocation(program->id, index, name->value.c_str());
55  
-}
56  
-
57  
-void WebGLRenderingContext::bindBuffer(GLenum target, WebGLBuffer *buffer) {
58  
-  glBindBuffer(target, buffer->id);
59  
-}
60  
-
61  
-void WebGLRenderingContext::bindFramebuffer(GLenum target, WebGLFramebuffer *framebuffer) {
62  
-}
63  
-
64  
-void WebGLRenderingContext::bindRenderbuffer(GLenum target, WebGLRenderbuffer *renderbuffer) {
65  
-
66  
-}
67  
-
68  
-void WebGLRenderingContext::bindTexture(GLenum target, WebGLTexture *texture) {
69  
-  glBindTexture(target, texture->id);
70  
-}
71  
-
72  
-void WebGLRenderingContext::blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
73  
-  glBlendColor(red, green, blue, alpha);
74  
-}
75  
-
76  
-void WebGLRenderingContext::blendEquation(GLenum mode) {
77  
-  glBlendEquation(mode);
78  
-}
79  
-
80  
-void WebGLRenderingContext::blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) {
81  
-  glBlendEquationSeparate(modeRGB, modeAlpha);
82  
-}
83  
-
84  
-void WebGLRenderingContext::blendFunc(GLenum sfactor, GLenum dfactor) {
85  
-  glBlendFunc(sfactor, dfactor);
86  
-}
87  
-
88  
-void WebGLRenderingContext::blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) {
89  
-  glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
90  
-}
91  
-
92  
-void WebGLRenderingContext::bufferData(GLenum target, GLsizeiptr size, GLenum usage) {
93  
-  glBufferData(target, size, 0, usage);
94  
-}
95  
-
96  
-void WebGLRenderingContext::bufferData(GLenum target, ArrayBufferView *data, GLenum usage) {
97  
-  glBufferData(target, data->length, (GLvoid *)&data, usage);
98  
-}
99  
-
100  
-void WebGLRenderingContext::bufferData(GLenum target, ArrayBuffer *data, GLenum usage) {
101  
-  glBufferData(target, data->size, data->data, usage);
102  
-}
103  
-
104  
-void WebGLRenderingContext::bufferSubData(GLenum target, GLintptr offset, ArrayBufferView *data) {
105  
-
106  
-}
107  
-
108  
-void WebGLRenderingContext::bufferSubData(GLenum target, GLintptr offset, ArrayBuffer *data) {
109  
-
110  
-}
111  
-
112  
-GLenum WebGLRenderingContext::checkFramebufferStatus(GLenum target) {
113  
-
114  
-}
115  
-
116  
-void WebGLRenderingContext::clear(GLbitfield mask) {
117  
-  glClear(mask);
118  
-}
119  
-
120  
-void WebGLRenderingContext::clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
121  
-  glClearColor(red, green, blue, alpha);
122  
-}
123  
-
124  
-void WebGLRenderingContext::clearDepth(GLclampf depth) {
125  
-  glClearDepth(depth);
126  
-}
127  
-
128  
-void WebGLRenderingContext::clearStencil(GLint s) {
129  
-  glClearStencil(s);
130  
-}
131  
-
132  
-void WebGLRenderingContext::colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) {
133  
-  glColorMask(red, green, blue, alpha);
134  
-}
135  
-
136  
-void WebGLRenderingContext::compileShader(WebGLShader *shader) {
137  
-  shader->compile();
138  
-}
139  
-
140  
-void WebGLRenderingContext::copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
141  
-  glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
142  
-}
143  
-
144  
-void WebGLRenderingContext::copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
145  
-  glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
146  
-}
147  
-
148  
-WebGLBuffer* WebGLRenderingContext::createBuffer() {
149  
-  // TODO: manage this memory
150  
-  return new WebGLBuffer();
151  
-}
152  
-
153  
-WebGLFramebuffer* WebGLRenderingContext::createFramebuffer() {
154  
-  // TODO: manage this memory
155  
-  return new WebGLFramebuffer();
156  
-}
157  
-
158  
-WebGLProgram* WebGLRenderingContext::createProgram() {
159  
-  // TODO: manage this memory
160  
-  return new WebGLProgram();
161  
-}
162  
-
163  
-WebGLRenderbuffer* WebGLRenderingContext::createRenderbuffer() {
164  
-  // TODO: manage this memory
165  
-  return new WebGLRenderbuffer();
166  
-}
167  
-
168  
-WebGLShader* WebGLRenderingContext::createShader(GLenum type) {
169  
-  // TODO: manage this memory
170  
-  return new WebGLShader(type);
171  
-}
172  
-
173  
-WebGLTexture* WebGLRenderingContext::createTexture() {
174  
-  // TODO: manage this memory
175  
-  return new WebGLTexture();
176  
-}
177  
-
178  
-
179  
-void WebGLRenderingContext::cullFace(GLenum mode) {
180  
-  glCullFace(mode);
181  
-}
182  
-
183  
-void WebGLRenderingContext::deleteBuffer(WebGLBuffer *buffer) {
184  
-
185  
-}
186  
-
187  
-void WebGLRenderingContext::deleteFramebuffer(WebGLFramebuffer *framebuffer) {
188  
-
189  
-}
190  
-
191  
-void WebGLRenderingContext::deleteProgram(WebGLProgram *program) {
192  
-
193  
-}
194  
-
195  
-void WebGLRenderingContext::deleteRenderbuffer(WebGLRenderbuffer *renderbuffer) {
196  
-
197  
-}
198  
-
199  
-void WebGLRenderingContext::deleteShader(WebGLShader *shader) {
200  
-
201  
-}
202  
-
203  
-void WebGLRenderingContext::deleteTexture(WebGLTexture *texture) {
204  
-
205  
-}
206  
-
207  
-void WebGLRenderingContext::depthFunc(GLenum func) {
208  
-  glDepthFunc(func);
209  
-}
210  
-
211  
-void WebGLRenderingContext::depthMask(GLboolean flag) {
212  
-  glDepthMask(flag);
213  
-}
214  
-
215  
-void WebGLRenderingContext::depthRange(GLclampf zNear, GLclampf zFar) {
216  
-  glDepthRange(zNear, zFar);
217  
-}
218  
-
219  
-void WebGLRenderingContext::detachShader(WebGLProgram *program, WebGLShader *shader) {
220  
-  glDetachShader(program->id, shader->id);
221  
-}
222  
-
223  
-void WebGLRenderingContext::disable(GLenum cap) {
224  
-  glDisable(cap);
225  
-}
226  
-
227  
-void WebGLRenderingContext::disableVertexAttribArray(GLuint index) {
228  
-  glDisableVertexAttribArray(index);
229  
-}
230  
-
231  
-void WebGLRenderingContext::drawArrays(GLenum mode, GLint first, GLsizei count) {
232  
-  glDrawArrays(mode, first, count);
233  
-}
234  
-
235  
-void WebGLRenderingContext::drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset) {
236  
-  glDrawElements(mode, count, type, (GLvoid *)&offset);
237  
-}
238  
-
239  
-void WebGLRenderingContext::enable(GLenum cap) {
240  
-  glEnable(cap);
241  
-}
242  
-
243  
-void WebGLRenderingContext::enableVertexAttribArray(GLuint index) {
244  
-  glEnableVertexAttribArray(index);
245  
-}
246  
-
247  
-void WebGLRenderingContext::finish() {
248  
-  glFinish();
249  
-}
250  
-
251  
-
252  
-void WebGLRenderingContext::flush() {
253  
-  glFlush();
254  
-}
255  
-
256  
-
257  
-void WebGLRenderingContext::framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer *renderbuffer) {
258  
-
259  
-}
260  
-
261  
-void WebGLRenderingContext::framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture *texture, GLint level) {
262  
-
263  
-}
264  
-
265  
-void WebGLRenderingContext::frontFace(GLenum mode) {
266  
-  glFrontFace(mode);
267  
-}
268  
-
269  
-void WebGLRenderingContext::generateMipmap(GLenum target) {
270  
-
271  
-}
272  
-
273  
-WebGLActiveInfo* WebGLRenderingContext::getActiveAttrib(WebGLProgram *program, GLuint index) {
274  
-
275  
-}
276  
-
277  
-WebGLActiveInfo* WebGLRenderingContext::getActiveUniform(WebGLProgram *program, GLuint index) {
278  
-
279  
-}
280  
-
281  
-WebGLShader** WebGLRenderingContext::getAttachedShaders(WebGLProgram *program) {
282  
-
283  
-}
284  
-
285  
-GLint WebGLRenderingContext::getAttribLocation(WebGLProgram *program, DOMString *name) {
286  
-  return glGetAttribLocation(program->id, name->value.c_str());
287  
-}
288  
-
289  
-void* WebGLRenderingContext::getParameter(GLenum pname) {
290  
-
291  
-}
292  
-
293  
-void* WebGLRenderingContext::getBufferParameter(GLenum target, GLenum pname) {
294  
-
295  
-}
296  
-
297  
-GLenum WebGLRenderingContext::getError() {
298  
-  return glGetError();
299  
-}
300  
-
301  
-
302  
-void* WebGLRenderingContext::getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname) {
303  
-
304  
-}
305  
-
306  
-bool WebGLRenderingContext::getProgramParameter(WebGLProgram *program, GLenum pname) {
307  
-  return program->status(pname);
308  
-}
309  
-
310  
-DOMString* WebGLRenderingContext::getProgramInfoLog(WebGLProgram *program) {
311  
-
312  
-}
313  
-
314  
-void* WebGLRenderingContext::getRenderbufferParameter(GLenum target, GLenum pname) {
315  
-
316  
-}
317  
-
318  
-void* WebGLRenderingContext::getShaderParameter(WebGLShader *shader, GLenum pname) {
319  
-
320  
-}
321  
-
322  
-DOMString* WebGLRenderingContext::getShaderInfoLog(WebGLShader *shader) {
323  
-
324  
-}
325  
-
326  
-DOMString* WebGLRenderingContext::getShaderSource(WebGLShader *shader) {
327  
-
328  
-}
329  
-
330  
-void* WebGLRenderingContext::getTexParameter(GLenum target, GLenum pname) {
331  
-
332  
-}
333  
-
334  
-void* WebGLRenderingContext::getUniform(WebGLProgram *program, WebGLUniformLocation *location) {
335  
-
336  
-}
337  
-
338  
-WebGLUniformLocation* WebGLRenderingContext::getUniformLocation(WebGLProgram *program, DOMString *name) {
339  
-
340  
-}
341  
-
342  
-void* WebGLRenderingContext::getVertexAttrib(GLuint index, GLenum pname) {
343  
-
344  
-}
345  
-
346  
-GLsizeiptr WebGLRenderingContext::getVertexAttribOffset(GLuint index, GLenum pname) {
347  
-
348  
-}
349  
-
350  
-void WebGLRenderingContext::hint(GLenum target, GLenum mode) {
351  
-  glHint(target, mode);
352  
-}
353  
-
354  
-GLboolean WebGLRenderingContext::isBuffer(WebGLBuffer *buffer) {
355  
-  if (buffer) {
356  
-    return glIsBuffer(buffer->id);
357  
-  } else {
358  
-    return false;
359  
-  }
360  
-}
361  
-
362  
-GLboolean WebGLRenderingContext::isEnabled(GLenum cap) {
363  
-  return glIsEnabled(cap);
364  
-}
365  
-
366  
-GLboolean WebGLRenderingContext::isFramebuffer(WebGLFramebuffer *framebuffer) {
367  
-  if (framebuffer) {
368  
-    return true;
369  
-  } else {
370  
-    return false;
371  
-  }
372  
-}
373  
-
374  
-GLboolean WebGLRenderingContext::isProgram(WebGLProgram *program) {
375  
-  if (program) {
376  
-    return glIsProgram(program->id);
377  
-  } else {
378  
-    return false;
379  
-  }
380  
-}
381  
-
382  
-GLboolean WebGLRenderingContext::isRenderbuffer(WebGLRenderbuffer *renderbuffer) {
383  
-  if (renderbuffer) {
384  
-    return true;
385  
-  } else {
386  
-    return false;
387  
-  }
388  
-}
389  
-
390  
-GLboolean WebGLRenderingContext::isShader(WebGLShader *shader) {
391  
-  if (shader) {
392  
-    return glIsShader(shader->id);
393  
-  } else {
394  
-    return false;
395  
-  }
396  
-}
397  
-
398  
-GLboolean WebGLRenderingContext::isTexture(WebGLTexture *texture) {
399  
-  if (texture) {
400  
-    return glIsTexture(texture->id);
401  
-  } else {
402  
-    return false;
403  
-  }
404  
-}
405  
-
406  
-void WebGLRenderingContext::lineWidth(GLfloat width) {
407  
-  glLineWidth(width);
408  
-}
409  
-
410  
-void WebGLRenderingContext::linkProgram(WebGLProgram *program) {
411  
-  program->link();
412  
-}
413  
-
414  
-void WebGLRenderingContext::pixelStorei(GLenum pname, GLint param) {
415  
-  glPixelStorei(pname, param);
416  
-}
417  
-
418  
-void WebGLRenderingContext::polygonOffset(GLfloat factor, GLfloat units) {
419  
-  glPolygonOffset(factor, units);
420  
-}
421  
-
422  
-void WebGLRenderingContext::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView *pixels) {
423  
-  glReadPixels(x, y, width, height, format, type, (GLvoid *)&pixels);
424  
-}
425  
-
426  
-void WebGLRenderingContext::renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
427  
-
428  
-}
429  
-
430  
-void WebGLRenderingContext::sampleCoverage(GLclampf value, GLboolean invert) {
431  
-  glSampleCoverage(value, invert);
432  
-}
433  
-
434  
-void WebGLRenderingContext::scissor(GLint x, GLint y, GLsizei width, GLsizei height) {
435  
-  glScissor(x, y, width, height);
436  
-}
437  
-
438  
-void WebGLRenderingContext::shaderSource(WebGLShader *shader, DOMString *source) {
439  
-  const char *cstring = source->value.c_str();
440  
-  glShaderSource(shader->id, 1, &cstring, NULL);
441  
-}
442  
-
443  
-void WebGLRenderingContext::stencilFunc(GLenum func, GLint ref, GLuint mask) {
444  
-  glStencilFunc(func, ref, mask);
445  
-}
446  
-
447  
-void WebGLRenderingContext::stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) {
448  
-  glStencilFuncSeparate(face, func, ref, mask);
449  
-}
450  
-
451  
-void WebGLRenderingContext::stencilMask(GLuint mask) {
452  
-  glStencilMask(mask);
453  
-}
454  
-
455  
-void WebGLRenderingContext::stencilMaskSeparate(GLenum face, GLuint mask) {
456  
-  glStencilMaskSeparate(face, mask);
457  
-}
458  
-
459  
-void WebGLRenderingContext::stencilOp(GLenum fail, GLenum zfail, GLenum zpass) {
460  
-  glStencilOp(fail, zfail, zpass);
461  
-}
462  
-
463  
-void WebGLRenderingContext::stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) {
464  
-  glStencilOpSeparate(face, fail, zfail, zpass);
465  
-}
466  
-
467  
-void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView *pixels) {
468  
-  glTexImage2D(target, level, internalformat, width, height, border, format, type, (GLvoid *)&pixels);
469  
-}
470  
-
471  
-void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData *pixels) {
472  
-  // glTexImage2D(target, level, internalformat, format, type, (GLvoid *)&pixels);
473  
-}
474  
-
475  
-void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, HTMLImageElement *image) {
476  
-  // glTexImage2D(target, level, internalformat, format, type, (GLvoid *)&image);
477  
-}
478  
-
479  
-void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, HTMLCanvasElement *canvas) {
480  
-  // glTexImage2D(target, level, internalformat, format, type, (GLvoid *)&canvas);
481  
-}
482  
-
483  
-void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, HTMLVideoElement *video) {
484  
-  // glTexImage2D(target, level, internalformat, format, type, (GLvoid *)&video);
485  
-}
486  
-
487  
-void WebGLRenderingContext::texParameterf(GLenum target, GLenum pname, GLfloat param) {
488  
-  glTexParameterf(target, pname, param);
489  
-}
490  
-
491  
-void WebGLRenderingContext::texParameteri(GLenum target, GLenum pname, GLint param) {
492  
-  glTexParameteri(target, pname, param);
493  
-}
494  
-
495  
-void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView *pixels) {
496  
-  glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, (GLvoid *)&pixels);
497  
-}
498  
-
499  
-void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, ImageData *pixels) {
500  
-  //glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, (GLvoid *)&pixels);
501  
-}
502  
-
503  
-void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLImageElement *image) {
504  
-  //glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, (GLvoid *)&pixels);
505  
-}
506  
-
507  
-void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLCanvasElement *canvas) {
508  
-  //glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, (GLvoid *)&pixels);
509  
-}
510  
-
511  
-void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLVideoElement *video) {
512  
-  //glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, (GLvoid *)&pixels);
513  
-}
514  
-
515  
-void WebGLRenderingContext::uniform1f(WebGLUniformLocation *location, GLfloat x) {
516  
-  glUniform1f(location->id, x);
517  
-}
518  
-
519  
-void WebGLRenderingContext::uniform1fv(WebGLUniformLocation *location, FloatArray *v) {
520  
-  glUniform1fv(location->id, v->length, (GLfloat *)&v);
521  
-}
522  
-
523  
-void WebGLRenderingContext::uniform1fv(WebGLUniformLocation *location, float** v) {
524  
-  glUniform1fv(location->id, sizeof(v), (GLfloat *)&v);
525  
-}
526  
-
527  
-void WebGLRenderingContext::uniform1i(WebGLUniformLocation *location, GLint x) {
528  
-  glUniform1i(location->id, x);
529  
-}
530  
-
531  
-void WebGLRenderingContext::uniform1iv(WebGLUniformLocation *location, Int32Array *v) {
532  
-  glUniform1iv(location->id, v->length, (GLint *)&v);
533  
-}
534  
-
535  
-void WebGLRenderingContext::uniform1iv(WebGLUniformLocation *location, long** v) {
536  
-  glUniform1iv(location->id, sizeof(v), (GLint *)&v);
537  
-}
538  
-
539  
-void WebGLRenderingContext::uniform2f(WebGLUniformLocation *location, GLfloat x, GLfloat y) {
540  
-  glUniform2f(location->id, x, y);
541  
-}
542  
-
543  
-void WebGLRenderingContext::uniform2fv(WebGLUniformLocation *location, FloatArray *v) {
544  
-  glUniform2fv(location->id, v->length, (GLfloat *)&v);
545  
-}
546  
-
547  
-void WebGLRenderingContext::uniform2fv(WebGLUniformLocation *location, float** v) {
548  
-  glUniform2fv(location->id, sizeof(v), (GLfloat *)&v);
549  
-}
550  
-
551  
-void WebGLRenderingContext::uniform2i(WebGLUniformLocation *location, GLint x, GLint y) {
552  
-  glUniform2i(location->id, x, y);
553  
-}
554  
-
555  
-void WebGLRenderingContext::uniform2iv(WebGLUniformLocation *location, Int32Array *v) {
556  
-  glUniform2iv(location->id, v->length, (GLint *)&v);
557  
-}
558  
-
559  
-void WebGLRenderingContext::uniform2iv(WebGLUniformLocation *location, long** v) {
560  
-  glUniform2iv(location->id, sizeof(v), (GLint *)&v);
561  
-}
562  
-
563  
-void WebGLRenderingContext::uniform3f(WebGLUniformLocation *location, GLfloat x, GLfloat y, GLfloat z) {
564  
-  glUniform3f(location->id, x, y, z);
565  
-}
566  
-
567  
-void WebGLRenderingContext::uniform3fv(WebGLUniformLocation *location, FloatArray *v) {
568  
-  glUniform3fv(location->id, v->length, (GLfloat *)&v);
569  
-}
570  
-
571  
-void WebGLRenderingContext::uniform3fv(WebGLUniformLocation *location, float** v) {
572  
-  glUniform3fv(location->id, sizeof(v), (GLfloat *)&v);