Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: How to use GLUT

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2013

    How to use GLUT

    how can i use glut.h
    in windows form application
    because i need to draw the sphere or cube in windows form application????

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Bay Area, CA, USA
    You don't use GLUT for this. GLUT is a simple event loop with a window and draw callbacks. If you want to render inside another windows framework you need to create an OpenGL context inside the onCreate and then inside onDraw make it current and draw.
    Last edited by dorbie; 03-08-2013 at 04:45 AM.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2013
    i use opengl with windows form application and i program GUI for this
    but when add the glut header to my program
    i dont able
    enough i add gl & glu
    but how can i draw sphere by using GLUTSpher???
    i make my header for opengl command
    and i add this to my GUI

    if i dont able ti do this?
    i need code to draw sphere using gl-point?
    Last edited by marahalsaidan; 03-08-2013 at 10:02 AM.

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2013


    i need code in opengl to draw the sphere by gl-point?????
    Last edited by marahalsaidan; 03-09-2013 at 03:10 AM.

  5. #5
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Montreal, Canada
    Quote Originally Posted by marahalsaidan View Post
    i need code in opengl to draw the sphere by gl-point?????
    If you just need to draw a sphere, then you can use glutSphere but why don't you use GLU instead?

    Call glPolygonMode(GL_FRONT_AND_BACK, GL_POINT) to set point mode.
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  6. #6
    Newbie Newbie
    Join Date
    Mar 2013
    lên n*o các b?n oi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts