Part of the Khronos Group
OpenGL.org

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
    Posts
    7

    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
    Location
    Bay Area, CA, USA
    Posts
    3,941
    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 05:45 AM.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2013
    Posts
    7
    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 11:02 AM.

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2013
    Posts
    7

    hiiii

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

  5. #5
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264
    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.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    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
    Posts
    1
    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
  •