http://www.freebasic.net/forum/viewtopi ... sh#p185208
is linked to the library FBGUI
I need a command to turn off the screen only leaving the system active...
This example puts out the screen after 5 seconds ...
I'm curious to see opengl visual changes that you could make ...
Code: Select all
'*******************
' MonitorOFF
'*******************
#include "windows.bi"
#Include "window9.bi"
#Include "GL/glut.bi"
Dim Shared As Integer OpenGL = 1
Sub RenderScene
Static i As Single
glClear GL_COLOR_BUFFER_BIT Or GL_DEPTH_BUFFER_BIT
glPushMatrix
glLoadIdentity
glTranslatef 0.0, 0.0, -3.0
glRotatef i, 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
i = i + 2.0f
OpenGLGadgetSwapBuffers opengl
End Sub
'http://www.codeproject.com/Tips/141076/Transparent-OpenGL-window
Var win = OpenWindow ("", 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
Dim Deb As Double
Deb = Timer
Do
RenderScene
Sleep 1
Loop Until (Timer - Deb) > 5
SendMessage(GetForegroundWindow(),WM_SYSCOMMAND,SC_MONITORPOWER,2)
End