Revision history for KeyPgScreencontrol


Revision [22638]

Last edited on 2019-03-12 04:32:02 by fxm [Formatting]
Additions:
##OGL_2D_MANUAL_SYNC## Manual rendering (when ##[[KeyPgFlip|Flip]]## is called)
Deletions:
##OGL_2D_MANUAL_SYNC## Manual rendering (when ##[[KeyPgFlip|Flip]]##/##[[KeyPgScreencopy|ScreenCopy]]## is called)


Revision [22637]

Edited on 2019-03-12 01:47:52 by fxm [Formatting]
Additions:
[IN] ##//param1//## zoom factor (0: no rendering)
Deletions:
[IN] ##//param1//## Zoom factor (0: no rendering)


Revision [22615]

Edited on 2019-03-10 16:07:30 by fxm [Suppressed the function codes values - Added a set operation: OpenGL 2D render]
Additions:
(""**"") denotes the operations that must be performed before the graphics mode is set via [[KeyPgScreengraphics|Screen (Graphics)]] or [[KeyPgScreenres|ScreenRes]],
Deletions:
(""**"") denotes operations that must be performed before the graphics mode is set via [[KeyPgScreengraphics|Screen (Graphics)]] or [[KeyPgScreenres|ScreenRes]],


Revision [22614]

Edited on 2019-03-10 16:03:31 by fxm [Suppressed the function codes values - Added a set operation: OpenGL 2D render]
Additions:
(""**"") denotes operations that must be performed before the graphics mode is set via [[KeyPgScreengraphics|Screen (Graphics)]] or [[KeyPgScreenres|ScreenRes]],
- (""**"") ##SET_GL_2D_MODE## Sets OpenGL 2D render
- (""**"") ##SET_GL_SCALE## Apply a zoom factor on OpenGL 2D render (only allowed if OpenGL 2D render mode has yet been activated via ##SET_GL_2D_MODE##)
Deletions:
- ##SET_GL_2D_MODE## Sets OpenGL 2D render
- ##SET_GL_SCALE## Apply a zoom factor on OpenGL 2D render (only allowed if OpenGL 2D render mode has yet been activated via ##SET_GL_2D_MODE##)


Revision [22599]

Edited on 2019-03-10 12:42:04 by fxm [Suppressed the function codes values - Added a set operation: OpenGL 2D render]
Additions:
- ##GET_VIEWPORT## Returns the current viewport as set by the [[KeyPgViewgraphics|View (Graphics)]] statement, in screen coordinates.
Deletions:
- ##GET_VIEWPORT## (##11##) Returns the current viewport as set by the [[KeyPgViewgraphics|View (Graphics)]] statement, in screen coordinates.


Revision [22598]

Edited on 2019-03-10 12:36:54 by fxm [Suppressed the function codes values - Added a set operation: OpenGL 2D render]
Additions:
##OGL_2D_MANUAL_SYNC## Manual rendering (when ##[[KeyPgFlip|Flip]]##/##[[KeyPgScreencopy|ScreenCopy]]## is called)
Deletions:
##OGL_2D_MANUAL_SYNC## Manual rendering (when Flip is called)


Revision [22597]

Edited on 2019-03-10 11:26:36 by fxm [Suppressed the functioncodes values - Added a set operation: OpenGL 2D render]
Additions:
[IN] ##//param1//## Zoom factor (0: no rendering)
Deletions:
[IN] ##//param1//## Zoom factor (0: No rendering)


Revision [22596]

Edited on 2019-03-10 11:18:22 by fxm [Suppressed the functioncodes values - Added a set operation: OpenGL 2D render]
Additions:
- ##GET_WINDOW_POS## Returns the current window position, in desktop coordinates.
- (*) ##GET_WINDOW_TITLE## Returns the title of the program window.
- ##GET_WINDOW_HANDLE## Returns a handle to the program window.
- (*) ##GET_DESKTOP_SIZE## Returns the desktop size, in pixels.
- ##GET_SCREEN_SIZE## Returns the current screen size in pixels.
- ##GET_SCREEN_DEPTH## Returns current graphics mode screen depth.
- ##GET_SCREEN_BPP## Returns current graphics mode BPP.
- ##GET_SCREEN_PITCH## Returns the current graphics mode framebuffer pitch, in bytes.
- ##GET_SCREEN_REFRESH## Returns the current graphics mode refresh rate, in hertz.
- ##GET_DRIVER_NAME## Returns the current graphics mode driver name.
- ##GET_TRANSPARENT_COLOR## Returns the transparent color value for the current graphics mode depth.
- ##GET_PEN_POS## Returns the last graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep|Step]]## keyword.
- ##GET_COLOR## Returns the current graphics mode color.
- ##GET_ALPHA_PRIMITIVES## Returns if primitives drawing support for alpha channel is enabled.
- ##GET_GL_EXTENSIONS## Returns a string holding all supported GL extensions, or the empty string if not in ""OpenGL"" mode.
- ##GET_HIGH_PRIORITY## Returns if ##GFX_HIGH_PRIORITY## was specified in the flags passed to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|Screenres]]##.
- ##SET_WINDOW_POS## Sets the current program window position, in desktop coordinates.
- (*) ##SET_WINDOW_TITLE## Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle|WindowTitle]]( //param// )##.
- ##SET_PEN_POS## Sets the current graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep|Step]]## keyword.
- (*) ##SET_DRIVER_NAME## Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]##.
- ##SET_ALPHA_PRIMITIVES## Sets if primitives drawing should honor alpha channel.
- (*) ##SET_GL_COLOR_BITS## Sets the number of bits dedicated to the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_RED_BITS## Sets the number of bits dedicated to the red component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_GREEN_BITS## Sets the number of bits dedicated to the green component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_BLUE_BITS## Sets the number of bits dedicated to the blue component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_ALPHA_BITS## Sets the number of bits dedicated to the alpha component of the ""OpenGL"" color buffer
- (*) ##SET_GL_DEPTH_BITS## Sets the number of bits dedicated to the ""OpenGL"" depth buffer
- (*) ##SET_GL_STENCIL_BITS## Sets the number of bits dedicated to the ""OpenGL"" stencil buffer
- (*) ##SET_GL_ACCUM_BITS## Sets the number of bits dedicated to the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_RED_BITS## Sets the number of bits dedicated to the red component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_GREEN_BITS## Sets the number of bits dedicated to the green component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_BLUE_BITS## Sets the number of bits dedicated to the blue component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_ALPHA_BITS## Sets the number of bits dedicated to the alpha component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_NUM_SAMPLES## Sets the number of samples to be used for ""OpenGL"" multisampling
- ##SET_GL_2D_MODE## Sets OpenGL 2D render
[IN] ##//param1//##:
##OGL_2D_NONE## No rendering
##OGL_2D_MANUAL_SYNC## Manual rendering (when Flip is called)
##OGL_2D_AUTO_SYNC## Automatic rendering
- ##SET_GL_SCALE## Apply a zoom factor on OpenGL 2D render (only allowed if OpenGL 2D render mode has yet been activated via ##SET_GL_2D_MODE##)
[IN] ##//param1//## Zoom factor (0: No rendering)
- ##POLL_EVENTS## Cause the library to poll all events, ie to check the system event queue, specifically used for retrieving keyboard and mouse events. This is most useful for ""OpenGL"" code where ##[[KeyPgFlip|Flip]]## is not used, as normally ##[[KeyPgFlip|Flip]]## will cause these events to be polled.
Deletions:
- ##GET_WINDOW_POS## (##0##) Returns the current window position, in desktop coordinates.
- (*) ##GET_WINDOW_TITLE## (##1##) Returns the title of the program window.
- ##GET_WINDOW_HANDLE## (##2##) Returns a handle to the program window.
- (*) ##GET_DESKTOP_SIZE## (##3##) Returns the desktop size, in pixels.
- ##GET_SCREEN_SIZE## (##4##) Returns the current screen size in pixels.
- ##GET_SCREEN_DEPTH## (##5##) Returns current graphics mode screen depth.
- ##GET_SCREEN_BPP## (##6##) Returns current graphics mode BPP.
- ##GET_SCREEN_PITCH## (##7##) Returns the current graphics mode framebuffer pitch, in bytes.
- ##GET_SCREEN_REFRESH## (##8##) Returns the current graphics mode refresh rate, in hertz.
- ##GET_DRIVER_NAME## (##9##) Returns the current graphics mode driver name.
- ##GET_TRANSPARENT_COLOR## (##10##) Returns the transparent color value for the current graphics mode depth.
- ##GET_PEN_POS## (##12##) Returns the last graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep|Step]]## keyword.
- ##GET_COLOR## (##13##) Returns the current graphics mode color.
- ##GET_ALPHA_PRIMITIVES## (##14##) Returns if primitives drawing support for alpha channel is enabled.
- ##GET_GL_EXTENSIONS## (##15##) Returns a string holding all supported GL extensions, or the empty string if not in ""OpenGL"" mode.
- ##GET_HIGH_PRIORITY## (##16##) Returns if ##GFX_HIGH_PRIORITY## was specified in the flags passed to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|Screenres]]##.
- ##SET_WINDOW_POS## (##100##) Sets the current program window position, in desktop coordinates.
- (*) ##SET_WINDOW_TITLE## (##101##) Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle|WindowTitle]]( //param// )##.
- ##SET_PEN_POS## (##102##) Sets the current graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep|Step]]## keyword.
- (*) ##SET_DRIVER_NAME## (##103##) Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]##.
- ##SET_ALPHA_PRIMITIVES## (##104##) Sets if primitives drawing should honor alpha channel.
- (*) ##SET_GL_COLOR_BITS## (##105##) Sets the number of bits dedicated to the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_RED_BITS## (##106##) Sets the number of bits dedicated to the red component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_GREEN_BITS## (##107##) Sets the number of bits dedicated to the green component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_BLUE_BITS## (##108##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_ALPHA_BITS## (##109##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" color buffer
- (*) ##SET_GL_DEPTH_BITS## (##110##) Sets the number of bits dedicated to the ""OpenGL"" depth buffer
- (*) ##SET_GL_STENCIL_BITS## (##111##) Sets the number of bits dedicated to the ""OpenGL"" stencil buffer
- (*) ##SET_GL_ACCUM_BITS## (##112##) Sets the number of bits dedicated to the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_RED_BITS## (##113##) Sets the number of bits dedicated to the red component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_GREEN_BITS## (##114##) Sets the number of bits dedicated to the green component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_BLUE_BITS## (##115##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_ALPHA_BITS## (##116##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_NUM_SAMPLES## (##117##) Sets the number of samples to be used for ""OpenGL"" multisampling
- ##POLL_EVENTS## (##200##) Cause the library to poll all events, ie to check the system event queue, specifically used for retrieving keyboard and mouse events. This is most useful for ""OpenGL"" code where ##[[KeyPgFlip|Flip]]## is not used, as normally ##[[KeyPgFlip|Flip]]## will cause these events to be polled.


Revision [22299]

Edited on 2018-04-25 10:14:22 by fxm [Added that GET_WINDOW_HANDLE places the Display ptr in param2 under X11]
Additions:
[OUT] ##//param2//## display ptr in X11


Revision [21920]

Edited on 2017-09-25 13:50:56 by fxm [Formatting]
Additions:
Note:
(*) denotes operations that are allowed while a graphics mode has not yet been set via [[KeyPgScreengraphics|Screen (Graphics)]] or [[KeyPgScreenres|ScreenRes]],
for all other operations, return values are zero (##0##) or the empty string (##"####"##) and the operation has no effect if a graphics mode is not available at call time.

- (*) ##GET_WINDOW_TITLE## (##1##) Returns the title of the program window.
- (*) ##GET_DESKTOP_SIZE## (##3##) Returns the desktop size, in pixels.
- (*) ##SET_WINDOW_TITLE## (##101##) Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle|WindowTitle]]( //param// )##.
- (*) ##SET_DRIVER_NAME## (##103##) Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]##.
- (*) ##SET_GL_COLOR_BITS## (##105##) Sets the number of bits dedicated to the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_RED_BITS## (##106##) Sets the number of bits dedicated to the red component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_GREEN_BITS## (##107##) Sets the number of bits dedicated to the green component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_BLUE_BITS## (##108##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" color buffer
- (*) ##SET_GL_COLOR_ALPHA_BITS## (##109##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" color buffer
- (*) ##SET_GL_DEPTH_BITS## (##110##) Sets the number of bits dedicated to the ""OpenGL"" depth buffer
- (*) ##SET_GL_STENCIL_BITS## (##111##) Sets the number of bits dedicated to the ""OpenGL"" stencil buffer
- (*) ##SET_GL_ACCUM_BITS## (##112##) Sets the number of bits dedicated to the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_RED_BITS## (##113##) Sets the number of bits dedicated to the red component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_GREEN_BITS## (##114##) Sets the number of bits dedicated to the green component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_BLUE_BITS## (##115##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_ACCUM_ALPHA_BITS## (##116##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" accumulation buffer
- (*) ##SET_GL_NUM_SAMPLES## (##117##) Sets the number of samples to be used for ""OpenGL"" multisampling
Deletions:
Note: * denotes operations that are allowed while a graphics mode has not yet been set via [[KeyPgScreengraphics|Screen (Graphics)]] or [[KeyPgScreenres|ScreenRes]]. For all other operations, return values are zero(##0##) or the empty string(##"####"##) and the operation has no effect if a graphics mode is not available at call time.
- * ##GET_WINDOW_TITLE## (##1##) Returns the title of the program window.
- * ##GET_DESKTOP_SIZE## (##3##) Returns the desktop size, in pixels.
- * ##SET_WINDOW_TITLE## (##101##) Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle|WindowTitle]]( //param// )##.
- * ##SET_DRIVER_NAME## (##103##) Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]##.
- * ##SET_GL_COLOR_BITS## (##105##) Sets the number of bits dedicated to the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_RED_BITS## (##106##) Sets the number of bits dedicated to the red component of the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_GREEN_BITS## (##107##) Sets the number of bits dedicated to the green component of the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_BLUE_BITS## (##108##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_ALPHA_BITS## (##109##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" color buffer
- * ##SET_GL_DEPTH_BITS## (##110##) Sets the number of bits dedicated to the ""OpenGL"" depth buffer
- * ##SET_GL_STENCIL_BITS## (##111##) Sets the number of bits dedicated to the ""OpenGL"" stencil buffer
- * ##SET_GL_ACCUM_BITS## (##112##) Sets the number of bits dedicated to the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_RED_BITS## (##113##) Sets the number of bits dedicated to the red component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_GREEN_BITS## (##114##) Sets the number of bits dedicated to the green component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_BLUE_BITS## (##115##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_ALPHA_BITS## (##116##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_NUM_SAMPLES## (##117##) Sets the number of samples to be used for ""OpenGL"" multisampling


Revision [21119]

Edited on 2016-03-13 10:06:36 by fxm [Formatting]
Additions:




Revision [20500]

Edited on 2016-02-10 16:08:06 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param1 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param2 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param3 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0, [[KeyPgByref|byref]] param4 [[KeyPgAs|as]] [[KeyPgInteger|integer]] = 0 )
[[KeyPgDeclare|declare]] [[KeyPgSub|sub]] **""ScreenControl""** ( [[KeyPgByval|byval]] what [[KeyPgAs|as]] [[KeyPgLong|long]], [[KeyPgByref|byref]] param [[KeyPgAs|as]] [[KeyPgString|string]] = ##"####"## )
The meaning of the ##//param*//## parameters depend on the ##//what//## parameter, whose possible values are defined as constants in ##fbgfx.bi##. In //[[CompilerDialects|lang fb]]//, they are set to be stored in the ##FB## ##[[KeyPgNamespace|Namespace]]##.
Note: * denotes operations that are allowed while a graphics mode has not yet been set via [[KeyPgScreengraphics|Screen (Graphics)]] or [[KeyPgScreenres|ScreenRes]]. For all other operations, return values are zero(##0##) or the empty string(##"####"##) and the operation has no effect if a graphics mode is not available at call time.
- ##GET_VIEWPORT## (##11##) Returns the current viewport as set by the [[KeyPgViewgraphics|View (Graphics)]] statement, in screen coordinates.
- ##GET_PEN_POS## (##12##) Returns the last graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep|Step]]## keyword.
- ##GET_HIGH_PRIORITY## (##16##) Returns if ##GFX_HIGH_PRIORITY## was specified in the flags passed to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|Screenres]]##.
- * ##SET_WINDOW_TITLE## (##101##) Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle|WindowTitle]]( //param// )##.
- ##SET_PEN_POS## (##102##) Sets the current graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep|Step]]## keyword.
- * ##SET_DRIVER_NAME## (##103##) Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]##.
- ##POLL_EVENTS## (##200##) Cause the library to poll all events, ie to check the system event queue, specifically used for retrieving keyboard and mouse events. This is most useful for ""OpenGL"" code where ##[[KeyPgFlip|Flip]]## is not used, as normally ##[[KeyPgFlip|Flip]]## will cause these events to be polled.
'' do a shake of the window
if (shakes > 1) then
'' move window to a random position near its original coordinates
x = x0 + int(32 * (rnd() - 0.5))
y = y0 + int(32 * (rnd() - 0.5))
screencontrol SET_WINDOW_POS, x, y
else
'' move window back to its original coordinates
screencontrol SET_WINDOW_POS, x0, y0
end if
shakes -= 1
select case e.type
'' user pressed the mouse button
case EVENT_MOUSE_BUTTON_PRESS
if (shakes = 0) then
'' set to do 20 shakes
shakes = 20
'' find current window coordinates to shake around
screencontrol GET_WINDOW_POS, x0, y0
end if
'' user closed the window or pressed a key
case EVENT_WINDOW_CLOSE, EVENT_KEY_PRESS
'' exit to end of program
exit do
end select
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Screencontrol""**##.
- ##[[KeyPgScreengraphics|Screen (Graphics)]]##
- ##[[KeyPgScreenevent|ScreenEvent]]##
- ##[[KeyPgScreeninfo|ScreenInfo]]##
- ##[[KeyPgWindowtitle|WindowTitle]]##
- ##[[KeyPgViewgraphics|View (Graphics)]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByref byref]] param1 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param2 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param3 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param4 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByref byref]] param [[KeyPgAs as]] [[KeyPgString string]] = ##"####"## )
The meaning of the ##//param*//## parameters depend on the ##//what//## parameter, whose possible values are defined as constants in ##fbgfx.bi##. In //[[CompilerDialects lang fb]]//, they are set to be stored in the ##FB## ##[[KeyPgNamespace Namespace]]##.
Note: * denotes operations that are allowed while a graphics mode has not yet been set via [[KeyPgScreengraphics Screen (Graphics)]] or [[KeyPgScreenres ScreenRes]]. For all other operations, return values are zero(##0##) or the empty string(##"####"##) and the operation has no effect if a graphics mode is not available at call time.
- ##GET_VIEWPORT## (##11##) Returns the current viewport as set by the [[KeyPgViewgraphics View (Graphics)]] statement, in screen coordinates.
- ##GET_PEN_POS## (##12##) Returns the last graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep Step]]## keyword.
- ##GET_HIGH_PRIORITY## (##16##) Returns if ##GFX_HIGH_PRIORITY## was specified in the flags passed to ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres Screenres]]##.
- * ##SET_WINDOW_TITLE## (##101##) Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle WindowTitle]]( //param// )##.
- ##SET_PEN_POS## (##102##) Sets the current graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep Step]]## keyword.
- * ##SET_DRIVER_NAME## (##103##) Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres ScreenRes]]##.
- ##POLL_EVENTS## (##200##) Cause the library to poll all events, ie to check the system event queue, specifically used for retrieving keyboard and mouse events. This is most useful for ""OpenGL"" code where ##[[KeyPgFlip Flip]]## is not used, as normally ##[[KeyPgFlip Flip]]## will cause these events to be polled.

'' do a shake of the window
if (shakes > 1) then
'' move window to a random position near its original coordinates
x = x0 + int(32 * (rnd() - 0.5))
y = y0 + int(32 * (rnd() - 0.5))
screencontrol SET_WINDOW_POS, x, y
else
'' move window back to its original coordinates
screencontrol SET_WINDOW_POS, x0, y0
end if
shakes -= 1
select case e.type

'' user pressed the mouse button
case EVENT_MOUSE_BUTTON_PRESS
if (shakes = 0) then
'' set to do 20 shakes
shakes = 20
'' find current window coordinates to shake around
screencontrol GET_WINDOW_POS, x0, y0
end if
'' user closed the window or pressed a key
case EVENT_WINDOW_CLOSE, EVENT_KEY_PRESS
'' exit to end of program
exit do
end select
- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Screencontrol""**##.
- ##[[KeyPgScreengraphics Screen (Graphics)]]##
- ##[[KeyPgScreenevent ScreenEvent]]##
- ##[[KeyPgScreeninfo ScreenInfo]]##
- ##[[KeyPgWindowtitle WindowTitle]]##
- ##[[KeyPgViewgraphics View (Graphics)]]##


Revision [17541]

Edited on 2015-04-01 12:46:40 by DkLwikki [integer => long]
Additions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByref byref]] param1 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param2 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param3 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param4 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgLong long]], [[KeyPgByref byref]] param [[KeyPgAs as]] [[KeyPgString string]] = ##"####"## )
Deletions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByref byref]] param1 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param2 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param3 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param4 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByref byref]] param [[KeyPgAs as]] [[KeyPgString string]] = ##"####"## )


Revision [16533]

Edited on 2013-01-16 11:45:08 by CountingPine [Change window dragging example to a different one that works better; add an example for getting/sett]
Additions:
'' use FB namespace for easy access to types/constants
using FB
dim as integer x0, y0, x, y
dim as integer shakes = 0
screenres 320, 200, 32
print "Click to shake window"
'' find window coordinates
screencontrol GET_WINDOW_POS, x0, y0
if (shakes > 0) then

'' do a shake of the window
if (shakes > 1) then
'' move window to a random position near its original coordinates
x = x0 + int(32 * (rnd() - 0.5))
y = y0 + int(32 * (rnd() - 0.5))
screencontrol SET_WINDOW_POS, x, y
else
'' move window back to its original coordinates
screencontrol SET_WINDOW_POS, x0, y0
end if
shakes -= 1
select case e.type

'' user pressed the mouse button
case EVENT_MOUSE_BUTTON_PRESS
if (shakes = 0) then
'' set to do 20 shakes
shakes = 20
'' find current window coordinates to shake around
screencontrol GET_WINDOW_POS, x0, y0
end if
'' user closed the window or pressed a key
case EVENT_WINDOW_CLOSE, EVENT_KEY_PRESS
'' exit to end of program
exit do
end select
'' free up CPU for other programs
loop
{{fbdoc item="filename" value="examples/manual/gfx/screencontrol2.bas"}}%%(freebasic)
dim as string driver
#ifdef __FB_WIN32__
'' set graphics driver to GDI (Win32 only), before calling ScreenRes
screencontrol FB.SET_DRIVER_NAME, "GDI"
#endif
screenres 640, 480
'' fetch graphics driver name and display it to user
screencontrol FB.GET_DRIVER_NAME, driver
print "Graphics driver name: " & driver
'' wait for a keypress before closing the window
sleep
Deletions:
using fb
dim as integer x, y, pressed, col
screenres 384, 64, 32,, GFX_SHAPED_WINDOW
'' create a fancy window shape
img = imagecreate(48,8)
draw string img, (0, 0), "GfxLib"
for y = 0 to 63
for x = 0 to 383
col = point(x \ 8, y \ 8, img)
if (col <> rgb(255, 0, 255)) then
col = rgb((x + y) and &hFF, (x + y) and &hFF, (x + y) and &hFF)
end if
pset (x, y), col
next x
next y
pressed = 0
select case e.type
case EVENT_MOUSE_BUTTON_PRESS
pressed = -1
case EVENT_MOUSE_BUTTON_RELEASE
pressed = 0
case EVENT_MOUSE_MOVE
if (pressed) then
screencontrol GET_WINDOW_POS, x, y
screencontrol SET_WINDOW_POS, x + e.dx, y + e.dy
end if
end select
loop while not multikey(1)


Revision [13934]

Edited on 2008-11-29 15:55:36 by LaananFisher [Updated: syntax, added usage]
Additions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByref byref]] param1 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param2 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param3 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0, [[KeyPgByref byref]] param4 [[KeyPgAs as]] [[KeyPgInteger integer]] = 0 )
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgInteger integer]], [[KeyPgByref byref]] param [[KeyPgAs as]] [[KeyPgString string]] = ##"####"## )
{{fbdoc item="usage"}}##
**""ScreenControl""**( //what// [, [ //param1// ][, [ //param2// ][, [ //param3// ][, [ //param4// ]]]]] )
##or,##
**""ScreenControl""**( //what// [, //param// ] )
Deletions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgInteger integer]] [, [[KeyPgByref byref]] param1 [[KeyPgAs as]] [[KeyPgInteger integer]] [, [[KeyPgByref byref]] param2 [[KeyPgAs as]] [[KeyPgInteger integer]] [, [[KeyPgByref byref]] param3 [[KeyPgAs as]] [[KeyPgInteger integer]] [, [[KeyPgByref byref]] param4 [[KeyPgAs as]] [[KeyPgInteger integer]]]]]] )
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **""ScreenControl""** ( [[KeyPgByval byval]] what [[KeyPgAs as]] [[KeyPgInteger integer]] [, [[KeyPgByref byref]] param [[KeyPgAs as]] [[KeyPgString string]]] )


Revision [13675]

Edited on 2008-09-01 19:55:19 by CountingPine [Mention FB namespace; formatting]
Additions:
This function can be used to set or get internal ""GfxLib"" states. The ##//what//## parameter specifies which operation to perform. On operations that set states, the ##//param*//## parameters must contain the values to be set. On operations that get states, ##//param*//## will hold the values returned by ""GfxLib"" when the function returns.
The meaning of the ##//param*//## parameters depend on the ##//what//## parameter, whose possible values are defined as constants in ##fbgfx.bi##. In //[[CompilerDialects lang fb]]//, they are set to be stored in the ##FB## ##[[KeyPgNamespace Namespace]]##.
Below is a list of the supported ##//what//## constants - and their values as defined at time of writing - along with the parameters associated with them.
Note: * denotes operations that are allowed while a graphics mode has not yet been set via [[KeyPgScreengraphics Screen (Graphics)]] or [[KeyPgScreenres ScreenRes]]. For all other operations, return values are zero(##0##) or the empty string(##"####"##) and the operation has no effect if a graphics mode is not available at call time.
- ##GET_WINDOW_POS## (##0##) Returns the current window position, in desktop coordinates.
- * ##GET_WINDOW_TITLE## (##1##) Returns the title of the program window.
- ##GET_WINDOW_HANDLE## (##2##) Returns a handle to the program window.
- * ##GET_DESKTOP_SIZE## (##3##) Returns the desktop size, in pixels.
- ##GET_SCREEN_SIZE## (##4##) Returns the current screen size in pixels.
- ##GET_SCREEN_DEPTH## (##5##) Returns current graphics mode screen depth.
- ##GET_SCREEN_BPP## (##6##) Returns current graphics mode BPP.
- ##GET_SCREEN_PITCH## (##7##) Returns the current graphics mode framebuffer pitch, in bytes.
- ##GET_SCREEN_REFRESH## (##8##) Returns the current graphics mode refresh rate, in hertz.
- ##GET_DRIVER_NAME## (##9##) Returns the current graphics mode driver name.
- ##GET_TRANSPARENT_COLOR## (##10##) Returns the transparent color value for the current graphics mode depth.
- ##GET_VIEWPORT## (##11##) Returns the current viewport as set by the [[KeyPgViewgraphics View (Graphics)]] statement, in screen coordinates.
- ##GET_PEN_POS## (##12##) Returns the last graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep Step]]## keyword.
- ##GET_COLOR## (##13##) Returns the current graphics mode color.
- ##GET_ALPHA_PRIMITIVES## (##14##) Returns if primitives drawing support for alpha channel is enabled.
[OUT] ##//param1//## ##TRUE## (##-1##) if alpha primitives is enabled, ##FALSE## (##0##) otherwise
- ##GET_GL_EXTENSIONS## (##15##) Returns a string holding all supported GL extensions, or the empty string if not in ""OpenGL"" mode.
- ##GET_HIGH_PRIORITY## (##16##) Returns if ##GFX_HIGH_PRIORITY## was specified in the flags passed to ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres Screenres]]##.
- ##SET_WINDOW_POS## (##100##) Sets the current program window position, in desktop coordinates.
- * ##SET_WINDOW_TITLE## (##101##) Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle WindowTitle]]( //param// )##.
- ##SET_PEN_POS## (##102##) Sets the current graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the ##[[KeyPgStep Step]]## keyword.
- * ##SET_DRIVER_NAME## (##103##) Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres ScreenRes]]##.
- ##SET_ALPHA_PRIMITIVES## (##104##) Sets if primitives drawing should honor alpha channel.
- * ##SET_GL_COLOR_BITS## (##105##) Sets the number of bits dedicated to the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_RED_BITS## (##106##) Sets the number of bits dedicated to the red component of the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_GREEN_BITS## (##107##) Sets the number of bits dedicated to the green component of the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_BLUE_BITS## (##108##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" color buffer
- * ##SET_GL_COLOR_ALPHA_BITS## (##109##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" color buffer
- * ##SET_GL_DEPTH_BITS## (##110##) Sets the number of bits dedicated to the ""OpenGL"" depth buffer
- * ##SET_GL_STENCIL_BITS## (##111##) Sets the number of bits dedicated to the ""OpenGL"" stencil buffer
- * ##SET_GL_ACCUM_BITS## (##112##) Sets the number of bits dedicated to the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_RED_BITS## (##113##) Sets the number of bits dedicated to the red component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_GREEN_BITS## (##114##) Sets the number of bits dedicated to the green component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_BLUE_BITS## (##115##) Sets the number of bits dedicated to the blue component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_ACCUM_ALPHA_BITS## (##116##) Sets the number of bits dedicated to the alpha component of the ""OpenGL"" accumulation buffer
- * ##SET_GL_NUM_SAMPLES## (##117##) Sets the number of samples to be used for ""OpenGL"" multisampling
- ##POLL_EVENTS## (##200##) Cause the library to poll all events, ie to check the system event queue, specifically used for retrieving keyboard and mouse events. This is most useful for ""OpenGL"" code where ##[[KeyPgFlip Flip]]## is not used, as normally ##[[KeyPgFlip Flip]]## will cause these events to be polled.
- New to ""FreeBASIC""
Deletions:
This function can be used to set or get internal GfxLib states. The ##//what//## parameter specifies which operation to perform. On operations that set states, the ##//param*//## parameters must contain the values to be set. On operations that get states, ##//param*//## will hold the values returned by GfxLib when the function returns.
The meaning of the ##//param*//## parameters depend on the ##//what//## parameter, whose possible values are defined as constants in fbgfx.bi; below is a list of the supported ##//what//## values, along with the parameters associated with them.
Note: * denotes operations that are allowed while a graphics mode has not yet been set via [[KeyPgScreengraphics Screen (Graphics)]] or [[KeyPgScreenres ScreenRes]]. For all other operations, return values are zero(0) or the empty string and the operation has no effect if a graphics mode is not available at call time.
- ##GET_WINDOW_POS## (0) Returns the current window position, in desktop coordinates.
- * ##GET_WINDOW_TITLE## (1) Returns the title of the program window.
- ##GET_WINDOW_HANDLE## (2) Returns a handle to the program window.
- * ##GET_DESKTOP_SIZE## (3) Returns the desktop size, in pixels.
- ##GET_SCREEN_SIZE## (4) Returns the current screen size in pixels.
- ##GET_SCREEN_DEPTH## (5) Returns current graphics mode screen depth.
- ##GET_SCREEN_BPP## (6) Returns current graphics mode BPP.
- ##GET_SCREEN_PITCH## (7) Returns the current graphics mode framebuffer pitch, in bytes.
- ##GET_SCREEN_REFRESH## (8) Returns the current graphics mode refresh rate, in hertz.
- ##GET_DRIVER_NAME## (9) Returns the current graphics mode driver name.
- ##GET_TRANSPARENT_COLOR## (10) Returns the transparent color value for the current graphics mode depth.
- ##GET_VIEWPORT## (11) Returns the current viewport as set by the [[KeyPgViewgraphics View (Graphics)]] statement, in screen coordinates.
- ##GET_PEN_POS## (12) Returns the last graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the [[KeyPgStep Step]] keyword.
- ##GET_COLOR## (13) Returns the current graphics mode color.
- ##GET_ALPHA_PRIMITIVES## (14) Returns if primitives drawing support for alpha channel is enabled.
[OUT] ##//param1//## TRUE (-1) if alpha primitives is enabled, FALSE (0) otherwise
- ##GET_GL_EXTENSIONS## (15) Returns a string holding all supported GL extensions, or the empty string if not in OpenGL mode.
- ##GET_HIGH_PRIORITY## (16) Returns if GFX_HIGH_PRIORITY was specified in the flags passed to ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres Screenres]]##.
- ##SET_WINDOW_POS## (100) Sets the current program window position, in desktop coordinates.
- * ##SET_WINDOW_TITLE## (101) Sets the current program window title. This is equivalent to calling ##[[KeyPgWindowtitle WindowTitle]]( //param// )##.
- ##SET_PEN_POS## (102) Sets the current graphical pen position, in screen coordinates. This position is used in graphics functions supporting relative coordinates using the [[KeyPgStep Step]] keyword.
- * ##SET_DRIVER_NAME## (103) Sets the name of the internal graphics driver to be used in subsequent calls to ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres ScreenRes]]##.
- ##SET_ALPHA_PRIMITIVES## (104) Sets if primitives drawing should honor alpha channel.
- * ##SET_GL_COLOR_BITS## (105) Sets the number of bits dedicated to the OpenGL color buffer
- * ##SET_GL_COLOR_RED_BITS## (106) Sets the number of bits dedicated to the red component of the OpenGL color buffer
- * ##SET_GL_COLOR_GREEN_BITS## (107) Sets the number of bits dedicated to the green component of the OpenGL color buffer
- * ##SET_GL_COLOR_BLUE_BITS## (108) Sets the number of bits dedicated to the blue component of the OpenGL color buffer
- * ##SET_GL_COLOR_ALPHA_BITS## (109) Sets the number of bits dedicated to the alpha component of the OpenGL color buffer
- * ##SET_GL_DEPTH_BITS## (110) Sets the number of bits dedicated to the OpenGL depth buffer
- * ##SET_GL_STENCIL_BITS## (111) Sets the number of bits dedicated to the OpenGL stencil buffer
- * ##SET_GL_ACCUM_BITS## (112) Sets the number of bits dedicated to the OpenGL accumulation buffer
- * ##SET_GL_ACCUM_RED_BITS## (113) Sets the number of bits dedicated to the red component of the OpenGL accumulation buffer
- * ##SET_GL_ACCUM_GREEN_BITS## (114) Sets the number of bits dedicated to the green component of the OpenGL accumulation buffer
- * ##SET_GL_ACCUM_BLUE_BITS## (115) Sets the number of bits dedicated to the blue component of the OpenGL accumulation buffer
- * ##SET_GL_ACCUM_ALPHA_BITS## (116) Sets the number of bits dedicated to the alpha component of the OpenGL accumulation buffer
- * ##SET_GL_NUM_SAMPLES## (117) Sets the number of samples to be used for OpenGL multisampling
- ##POLL_EVENTS## (200) Cause the library to poll all events, ie to check the system event queue, specifically used for retrieving keyboard and mouse events. This is most useful for OpenGL code where FLIP is not used, as normally FLIP will cause these events to be polled.
- New to FreeBASIC


Revision [13168]

The oldest known version of this page was created on 2008-04-24 15:43:50 by JeffMarshall [Mention FB namespace; formatting]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode