Abstract circle for test (OpenGL)

Share your advanced PureBasic knowledge/code with the community.
threedslider
User
User
Posts: 74
Joined: Sat Feb 12, 2022 7:15 pm

Abstract circle for test (OpenGL)

Post by threedslider »

Hi,

New code here :

Code: Select all

;;;
;;;  Created by threedslider -- 11/27/2023
;;;

InitSprite()
InitKeyboard()


OpenWindow(0, 0, 0, 800, 600, "OpenGL : Abstract Circle for test", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600)


glMatrixMode_(#GL_PROJECTION)
glLoadIdentity_() 
gluPerspective_(45.0, 800/600, 1.0, 60.0)
glMatrixMode_(#GL_MODELVIEW)
glTranslatef_(0, 0, -50)
glShadeModel_(#GL_SMOOTH)
glEnable_(#GL_LIGHT0)
glEnable_(#GL_LIGHTING)
glEnable_(#GL_COLOR_MATERIAL)
glEnable_(#GL_DEPTH_TEST)
glEnable_(#GL_CULL_FACE)   
glViewport_(0, 0, 800, 600)

x.i = 0

Repeat
glClearColor_(0.1, 0.1, 0.1, 0) ; background color
  glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
  Repeat
    event = WindowEvent()
    Select Event
      Case #PB_Event_CloseWindow
        quit = 1
     EndSelect
   Until event = 0
   
    
    For x = 0 To 360
    
    move.f  +  1/100000
    
      wave_x.f =  Cos(move- x + Sin(move+x)) * 50 *Exp((Cos(x))/50) * Cos(move+Cos(x))
      
      wave_y.f =  Sin(move+ x + Cos(move-x)) * 50 *Exp((Sin(-x))/50) * Sin(move+x)
     
          
    glBegin_(#GL_POINTS)
    glColor3f_(1.0, 0.3, 1.0)
    glVertex3f_( wave_x*0.3, wave_y*0.3, 0.3) 
    
    glEnd_();
    
    glPointSize_(3.0)
         
  Next
  
  If x = 360
    x = 0
  EndIf
  
   
 FlipBuffers()
 
 ExamineKeyboard()
 
Until KeyboardPushed(#PB_Key_Escape) Or quit = 1

juergenkulow
Enthusiast
Enthusiast
Posts: 524
Joined: Wed Sep 25, 2019 10:18 am

Re: Abstract circle for test (OpenGL)

Post by juergenkulow »

Under Linux I only see the background, but no purple dots.
threedslider
User
User
Posts: 74
Joined: Sat Feb 12, 2022 7:15 pm

Re: Abstract circle for test (OpenGL)

Post by threedslider »

Strange because in windows is working though ...

Maybe put a comment on glEnable_(#GL_CULL_FACE) to disable and see if it works for you ?
juergenkulow
Enthusiast
Enthusiast
Posts: 524
Joined: Wed Sep 25, 2019 10:18 am

Re: Abstract circle for test (OpenGL)

Post by juergenkulow »

Commenting out does not bring any improvement.
threedslider
User
User
Posts: 74
Joined: Sat Feb 12, 2022 7:15 pm

Re: Abstract circle for test (OpenGL)

Post by threedslider »

So it is a bug I think but not sure :?

@Fred : You think it is a bug on Linux ? Please test it for confirmation ? Thanks.
juergenkulow
Enthusiast
Enthusiast
Posts: 524
Joined: Wed Sep 25, 2019 10:18 am

[no bug]Re: Abstract circle for test (OpenGL)

Post by juergenkulow »

Code: Select all

    CompilerIf #PB_OS_Linux=#PB_Compiler_OS
      glVertex3f_(50* wave_x, 50*wave_y, 25) 
    CompilerEndIf 
Post Reply