summaryrefslogtreecommitdiff
path: root/progs/beos
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-09-19 16:19:43 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-09-19 16:19:43 +0000
commit473e51f2fbfb003717bb88616ea585fc8d76f75e (patch)
treef1ce211df7e089916bb720d36f8a950ef4624f4f /progs/beos
parentcbc1fb0a9a4c97a36608fb20483246559b4c2f76 (diff)
Updated BeOS support (Philippe Houdoin)
Diffstat (limited to 'progs/beos')
-rw-r--r--progs/beos/sample.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/progs/beos/sample.cpp b/progs/beos/sample.cpp
index 2310b33882..7b8515b275 100644
--- a/progs/beos/sample.cpp
+++ b/progs/beos/sample.cpp
@@ -32,7 +32,7 @@ class SampleGLWindow : public BWindow
{
public:
SampleGLWindow(BRect frame, uint32 type);
- virtual bool QuitRequested() { return true; }
+ virtual bool QuitRequested() { be_app->PostMessage(B_QUIT_REQUESTED); return true; }
private:
SampleGLView *theView;
@@ -135,7 +135,7 @@ void SampleGLView::gInit(void)
use_stipple_mode = GL_FALSE;
use_smooth_mode = GL_TRUE;
linesize = 2;
- pointsize = 4;
+ pointsize = 6;
}
@@ -147,35 +147,46 @@ void SampleGLView::gDraw(void)
glClear(GL_COLOR_BUFFER_BIT);
glLineWidth(linesize);
+/*
+
if (use_stipple_mode) {
glEnable(GL_LINE_STIPPLE);
} else {
glDisable(GL_LINE_STIPPLE);
}
-
- if (use_smooth_mode) {
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_BLEND);
- } else {
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_BLEND);
- }
-
+*/
+
+ glDisable(GL_POINT_SMOOTH);
+
+
glPushMatrix();
+ glPointSize(pointsize); // Set size for point
+
for (i = 0; i < 360; i += 5) {
glRotatef(5.0, 0,0,1); // Rotate right 5 degrees
+
+ if (use_smooth_mode) {
+ glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_BLEND);
+ } else {
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_BLEND);
+ }
+
glColor3f(1.0, 1.0, 0.0); // Set color for line
glBegin(GL_LINE_STRIP); // And create the line
- glVertex3fv(pntA);
- glVertex3fv(pntB);
+ glVertex3fv(pntA);
+ glVertex3fv(pntB);
glEnd();
-
- glPointSize(pointsize); // Set size for point
+
+ glDisable(GL_POINT_SMOOTH);
+ glDisable(GL_BLEND);
+
glColor3f(0.0, 1.0, 0.0); // Set color for point
glBegin(GL_POINTS);
- glVertex3fv(pntA); // Draw point at one end
- glVertex3fv(pntB); // Draw point at other end
+ glVertex3fv(pntA); // Draw point at one end
+ glVertex3fv(pntB); // Draw point at other end
glEnd();
}