wizardsqert.blogg.se

Purebasic openwindow example
Purebasic openwindow example













purebasic openwindow example
  1. #Purebasic openwindow example code
  2. #Purebasic openwindow example zip

ScreenArray = CocoaMessage(0, 0, "NSScreen screens") And then Return it To its original location. The Trick: To align the axis of the helix along the y-axis prior To rotation

purebasic openwindow example

T.f = -10*#PI // Angle parameter along helix. GlClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT) Clear The Screen And The Depth Buffer GlTranslatef_(0, 0, -120) move it forward a bit Global ZoomFactor.f Distance of the camera OpenWindow(0, 0, 0, 800, 600, "rotating Helix", #PB_Window_SystemMenu | #PB_Window_Invisible)

purebasic openwindow example

#Purebasic openwindow example code

i have copied the cpp code inside the example 1 code and just a small change i made to get the code works. but alas the book are paper only, and nowadays who want to read that microscopic characters on paper !!.

#Purebasic openwindow example zip

Until Quit = 1 Or KeyboardPushed(#PB_Key_Escape)Įnd Example 2: this example are using "rotatingHelix1.cpp" which can be downloaded free from (the code zip 6MB) don't forget to download chapter 2, 9, 11 it is a good lessons. GlClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT) GlViewport_(0, 0, WindowWidth(0), WindowHeight(0)) RotateSpeedX = 2.0 The speed of the rotation For the 3 axis except the colour which is nice blue To white gradiant The other face is the same than the previous one Now, the color stuff: It's r,v,b but with float values which 4 vertexes (GL_QUADS) form a rectangular surface. glBegin() specify how the vertexes are considered. GlClear_ (#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT) GlRotatef_ (RollAxisZ, 0, 0, 1.0) rotate around Z axis GlRotatef_ (RollAxisY, 0, 1.0, 0) rotate around Y axis GlRotatef_ (RollAxisX, 1.0, 0, 0) rotate around X axis GlTranslatef_(0, 0, ZoomFactor) move it forward a bit GlPushMatrix_() Save the original Matrix coordinates GlEnable_(#GL_COLOR_MATERIAL) color tracking GlColorMaterial_(#GL_FRONT, #GL_AMBIENT_AND_DIFFUSE) MessageRequester("Error", "Can't open screen & sprite environment!") MessageRequester("Error", "Please set the Library subsystem to OpenGL from IDE : Compiler. used here in the Fourth example onlyĮxample 1 : the same cube example in "PureBasic\Examples\Sources - Advanced\OpenGL Cube\OpenGL.pb" but deleting all the mysterious functions mentioned aboveĬompilerIf #PB_Compiler_OS = #PB_OS_Windows thank for remi_meier for keeping these files alive many years. This subject are discussed here before by other users, and i just refresh it in another way.īefore presenting some examples i suggest to download the glu.pbi in the package "" provided by remi_meier at the end of this thread. together with everyday normal purebasic functions While in purebasic you can learn OpenGL focusing only on the OpenGL functions. they are frustrating me and surely frustrating some users. The special preparations are characterized by the usage of mysterious functions such as "wglCreateContext(hDC)", "SetupPixelFormat() "PIXELFORMATDESCRIPTOR". I suspect that the purebasic collection (OpenWindow + OpenWindowedScreen + InitSprite) are OpenGLiZED, ie they provides the suitable environment to use Opengl functions immediately without special preparations such as used in C/C++ (win32 projects) or the example in PB distribution in "PureBasic\Examples\Sources - Advanced\OpenGL Cube\OpenGL.pb"















Purebasic openwindow example