This following code is from Jay IIRC :<br><br>#lang racket/gui
<br> <br>(require (lib "gl.ss" "sgl")
<br> (lib "gl-vectors.ss" "sgl")
<br>)
<br> <br> <br>(define (resize w h)
<br> (glViewport 0 0 w h)
<br> #t
<br>)
<br> <br>(define (draw-opengl)
<br> (glClearColor 0.0 0.0 0.0 0.0)
<br> (glClear GL_COLOR_BUFFER_BIT)
<br> (glColor3d 1.0 1.0 1.0)
<br>
<br> (glMatrixMode GL_PROJECTION)
<br> (glLoadIdentity)
<br> (glOrtho 0.0 1.0 0.0 1.0 -1.0 1.0)
<br> (glMatrixMode GL_MODELVIEW)
<br> (glLoadIdentity)
<br> <br> (glBegin GL_QUADS)
<br> (glVertex3d 0.25 0.25 0.0)
<br> (glVertex3d 0.75 0.25 0.0)
<br> (glVertex3d 0.75 0.75 0.0)
<br> (glVertex3d 0.25 0.75 0.0)
<br> (glEnd)
<br>)
<br> <br> <br>(define my-canvas%
<br> (class* canvas% ()
<br> (inherit with-gl-context swap-gl-buffers)
<br>
<br> (define/override (on-paint)
<br> (with-gl-context
<br> (lambda ()
<br> (draw-opengl)
<br> (swap-gl-buffers)
<br> )
<br> )
<br> )
<br>
<br> (define/override (on-size width height)
<br> (with-gl-context
<br> (lambda ()
<br> (resize width height)
<br> )
<br> )
<br> )
<br>
<br> (super-instantiate () (style '(gl)))
<br> )
<br>)
<br> <br>(define win (new frame% (label "OpenGl Test") (min-width 200) (min-height 200)))
<br>(define gl (new my-canvas% (parent win)))
<br> <br>(send win show #t)
<br> <br><br><br>It should be pretty easy to tweak it.<br><br>Hope this helps,<br>Laurent<br><br><br><div class="gmail_quote">On Sun, Oct 24, 2010 at 01:35, 김태윤 <span dir="ltr"><<a href="mailto:kty1104@gmail.com">kty1104@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">thank you for your suggestion<div>since I am a beginner, the code is pretty big for me</div>
<div>is there any hello world level code?</div><div><br></div><div>thanks in advanced<br><br><div class="gmail_quote">2010/10/24 김태윤 <span dir="ltr"><<a href="mailto:kty1104@gmail.com" target="_blank">kty1104@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">thank you!<br><br><div class="gmail_quote">2010/10/24 Noel Welsh <span dir="ltr"><<a href="mailto:noelwelsh@gmail.com" target="_blank">noelwelsh@gmail.com</a>></span><div class="im">
<div>
<div></div><div><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Basically, you get the gl-context from a MrEd frame. See the example here:<br>
<br>
<a href="http://github.com/plt/racket/blob/master/collects/sgl/examples/gl-frame.rkt" target="_blank">http://github.com/plt/racket/blob/master/collects/sgl/examples/gl-frame.rkt</a><br>
<br>
There are other examples in the same directory.<br>
<br>
HTH,<br>
<font color="#888888">N.<br>
</font><div><div></div><div><br>
On Sat, Oct 23, 2010 at 2:06 PM, 김태윤 <<a href="mailto:kty1104@gmail.com" target="_blank">kty1104@gmail.com</a>> wrote:<br>
> but I realize that this code lack of frame that will shows the color or<br>
> object<br>
> and also I can't find how to use glFlush function in scheme<br>
> could somebody please help me how to display 3d object or just color?<br>
> thanks in advanced<br>
</div></div></blockquote></div></div></div></div><br>
</blockquote></div><br></div>
<br>_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br></blockquote></div><br>