Beispiele
Übersicht
Beispiele 1
Beispiele 2
Beispiele 3
Beispiele 4
Beispiele 5
Beispiele 6
Erweiterungen
 

Splashscreen mit OpenGL & window9


#Include "window9.bi" #Include "GL/glut.bi" Dim Shared As Integer OpenGL = 1 Sub RenderScene Static rtri As Single glClear GL_COLOR_BUFFER_BIT Or GL_DEPTH_BUFFER_BIT glPushMatrix glLoadIdentity glTranslatef 0.0, 0.0, -3.0 glRotatef rtri, 0, 1, 0 glBegin GL_TRIANGLES glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Front) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f -1.0,-1.0, 1.0 'Left Of Triangle Front) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f 1.0,-1.0, 1.0 'Right Of Triangle Front) glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Right) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f 1.0,-1.0, 1.0 'Left Of Triangle Right) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f 1.0,-1.0,-1.0 'Right Of Triangle Right) glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Back) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f 1.0,-1.0,-1.0 'Left Of Triangle Back) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f -1.0,-1.0,-1.0 'Right Of Triangle Back) glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Left) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f -1.0,-1.0,-1.0 'Left Of Triangle Left) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f -1.0,-1.0, 1.0 'Right Of Triangle Left) glEnd glPopMatrix rtri = rtri + 2.0 OpenGLGadgetSwapBuffers opengl End Sub 'http://www.codeproject.com/Tips/141076/Transparent-OpenGL-window Var win = OpenWindow ("Transparent", 0,0,640,480, WS_POPUP Or WS_VISIBLE, WS_EX_LAYERED ) SetLayeredWindowAttributes(win, 0, 0, LWA_COLORKEY) CenterWindow win OpenGLGadget(OpenGL, 0, 0, WindowClientWidth(win), WindowClientHeight(win)) 'glEnable GL_ALPHA_TEST glEnable GL_DEPTH_TEST 'glEnable GL_COLOR_MATERIAL 'Transparent-OpenGL-window 'glEnable GL_BLEND 'glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA glClearColor 0, 0, 0, 0 Do Var event = WindowEvent If event = EventClose Then End If EventKEY = 27 Then End 'ESC RenderScene Sleep 1 Loop

Splashscreen mit OpenGL & fbgfx


#Include "windows.bi" #Include "GL/glu.bi" Sub RenderScene Static rtri As Single glClear GL_COLOR_BUFFER_BIT Or GL_DEPTH_BUFFER_BIT glPushMatrix glLoadIdentity glTranslatef 0.0, 0.0, -4.0 glRotatef rtri, 0, 1, 0 glBegin GL_TRIANGLES glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Front) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f -1.0,-1.0, 1.0 'Left Of Triangle Front) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f 1.0,-1.0, 1.0 'Right Of Triangle Front) glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Right) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f 1.0,-1.0, 1.0 'Left Of Triangle Right) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f 1.0,-1.0,-1.0 'Right Of Triangle Right) glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Back) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f 1.0,-1.0,-1.0 'Left Of Triangle Back) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f -1.0,-1.0,-1.0 'Right Of Triangle Back) glColor3f 1.0, 0.0, 0.0 'Red glVertex3f 0.0, 1.0, 0.0 'Top Of Triangle Left) glColor3f 0.0, 0.0, 1.0 'Blue glVertex3f -1.0,-1.0,-1.0 'Left Of Triangle Left) glColor3f 0.0, 1.0, 0.0 'Green glVertex3f -1.0,-1.0, 1.0 'Right Of Triangle Left) glEnd glPopMatrix rtri = rtri + 2.0 Flip End Sub ScreenRes 640, 480, 32,,2 'OpenGL-Modus Dim As HWND hwnd ScreenControl(2 ,Cast(Integer, hwnd)) 'GET_WINDOW_HANDLE 'http://msdn.microsoft.com/de-de/library/bb979284.aspx SetWindowLong hwnd, GWL_STYLE, WS_POPUP Or WS_VISIBLE 'geränderten Fensterstil setzen SetWindowLong hwnd, GWL_EXSTYLE, WS_EX_LAYERED 'erweiterter Fensterstil setzen SetLayeredWindowAttributes(hwnd, 0, 0, LWA_COLORKEY)'Transparenzinformationen zuweisen glViewport 0, 0, 640, 480 ' Reset The Current Viewport glMatrixMode GL_PROJECTION ' Select The Projection Matrix glLoadIdentity ' Reset The Projection Matrix gluPerspective 45.0, 640.0/480.0, 0.1, 100.0 ' Calculate The Aspect Ratio Of The Window glMatrixMode GL_MODELVIEW ' Select The Modelview Matrix glLoadIdentity ' Reset The Modelview Matrix 'glEnable GL_ALPHA_TEST glEnable GL_DEPTH_TEST 'Transparent-OpenGL-window 'glEnable GL_BLEND 'glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA glClearColor 0, 0, 0, 0 Do RenderScene Sleep 1 Loop While InKey = ""