// IMPROVMENT: use alpha testing? might be faster
#include <org/xwt/plat/OpenGL.h>
-#include <org/xwt/plat/OpenGL$GLDoubleBuffer.h>
+#include <org/xwt/plat/OpenGL$GLPixelBuffer.h>
#include <org/xwt/plat/OpenGL$GLPicture.h>
#include <org/xwt/plat/OpenGL$RectGLPicture.h>
#include <org/xwt/plat/OpenGL$SquareGLPicture.h>
version = JvNewStringLatin1(s==0 ? "" : (char*)s);
}
-void OpenGL$GLDoubleBuffer::drawableInit(jint width, jint height) {
+void OpenGL$GLPixelBuffer::drawableInit(jint width, jint height) {
glClearColor (0.3f, 0.7f, 1.0f, 1.0f);
glClearDepth( 0.0f );
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
checkGLError();
}
-void OpenGL$GLDoubleBuffer::setColor(jint argb) {
+void OpenGL$GLPixelBuffer::setColor(jint argb) {
float alpha = ((argb >> 24) & 0xff) / 255.0;
float red = ((argb >> 16) & 0xff) / 255.0;
float green = ((argb >> 8) & 0xff) / 255.0;
glColor4f(red,green,blue,alpha);
}
-void OpenGL$GLDoubleBuffer::fillTrapezoid(jint x1, jint x2, jint y1, jint x3, jint x4, jint y2, jint color) {
+void OpenGL$GLPixelBuffer::fillTrapezoid(jint x1, jint x2, jint y1, jint x3, jint x4, jint y2, jint color) {
activateContext();
setColor(color);
glBegin(GL_QUADS);
glEnd();
}
-void OpenGL$GLDoubleBuffer::fillRect(jint x1, jint y1, jint x2, jint y2,jint color) {
+void OpenGL$GLPixelBuffer::fillRect(jint x1, jint y1, jint x2, jint y2,jint color) {
activateContext();
setColor(color);
glBegin(GL_QUADS);
glEnd();
}
-void OpenGL$GLDoubleBuffer::setClip(jint x1, jint y1, jint x2, jint y2) {
+void OpenGL$GLPixelBuffer::setClip(jint x1, jint y1, jint x2, jint y2) {
//fprintf(stderr,"setClip: %d %d %d %d\n",x1,y1,x2,y2);
if(x1==0 && y1==0 && x2==width && y2==height) {
if(glScissorEnabled) {
checkGLError();
}
-void OpenGL$GLDoubleBuffer::resetClip() {
+void OpenGL$GLPixelBuffer::resetClip() {
activateContext();
if(glScissorEnabled) {
glDisable(GL_SCISSOR_TEST);