Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em

Class EM_VIDEO_SUBSYSTEM


Direct ancestors

EM_SUBSYSTEM, SDL_VIDEO_FUNCTIONS_EXTERNAL, SDL_MOUSE_FUNCTIONS_EXTERNAL, SDL_GLATTR_ENUM_EXTERNAL

Creation

Features

Invariants

indexing

description

Singleton representing the video subsystem.
Use EM_SHARED_SUBSYSTEMS to access this class.

date

$Date: 2005/10/26 14:37:03 $

revision

$Revision: 1.12 $

class

EM_VIDEO_SUBSYSTEM

inherit

EM_SUBSYSTEM

create {EM_SHARED_SUBSYSTEMS}

make
ensure
not_enabled: not is_enabled

feature -- Access

default_cursor: EM_CURSOR

-- Default screen cursor

video_surface: EM_VIDEO_SURFACE

-- Video surface

video_surface_bpp: INTEGER

-- Bits per pixel of the video surface

video_surface_height: INTEGER

-- Height of the video surface

video_surface_width: INTEGER

-- Width of the video surface

feature -- Status report

is_cursor_visible: BOOLEAN

-- Is cursor currently visible?

is_enabled: BOOLEAN

-- Is video subsystem enabled?

-- (From EM_SUBSYSTEM)

feature -- Status setting

hide_cursor

-- Make mouse cursor invisible.

set_cursor_visibility (a_value: BOOLEAN)

-- If a_value is True make cursor visible,
-- else make it invisible.

show_cursor

-- Make mouse cursor visible.

toggle_cursor_visibility

-- Make mouse cursor visible if it was previously invisible and vice versa.

feature -- Element change

set_video_bpp (a_resolution: INTEGER)

-- Set the video surface bits per pixel to a_resolution.
-- a_resolution of 24 is a lot slower than 8, 16 or 32.

ensure
bpp_set: video_surface_bpp = a_resolution
set_video_surface_height (a_height: INTEGER)

-- Set the video surface height to a_height.

ensure
height_set: video_surface_height = a_height
set_video_surface_width (a_width: INTEGER)

-- Set the video surface width to a_width.

ensure
width_set: video_surface_width = a_width

feature -- Subsystem management

base_disable

-- Disable basic systems.

-- (From EM_SUBSYSTEM)

base_enable

-- Enable basic systems.

-- (From EM_SUBSYSTEM)

disable

-- (From EM_SUBSYSTEM)

require
enabled: is_enabled
enable

-- Create an EiffelMedia system with the video subsystem enabled and
-- the time subsystem enabled.

-- (From EM_SUBSYSTEM)

require
not_enabled: not is_enabled
enabled_subsystem_count: DS_CELL [INTEGER]

-- Count of enabled subsystems

-- (From EM_SUBSYSTEM)

feature -- Video subsystem flags-- The flags below are relevant for sdl_set_video_mode_external used above-- AND for sdl_createRGBSurface_external not used until now.

anyformat: BOOLEAN

-- Should the video subsystem be forced to use
-- a given surface even if the requested bits per pixel are not available?

async_blit: BOOLEAN

-- Does the video subsystem use asynchronous blits if it is possible?
-- This can speed up blitting on multiple CPU machines or SMP systems.

-- The flags below are relevant for sdl_set_video_mode_external used above.

doublebuffered: BOOLEAN

-- Does the video subsystem use doublebuffering?

fullscreen: BOOLEAN

-- Does the video subsystem use fullscreen?

hardware_surface: BOOLEAN

-- Is the displayed surface in video memory?

hwpalette: BOOLEAN

-- Does the video subsystem have access to the hard ware palette?

noframe: BOOLEAN

-- Does the window created have no frame?

opengl: BOOLEAN

-- Is opengl enabled without OpenGL video attributes?

resizeable: BOOLEAN

-- Is the window created by the video subsystem resizeable?

set_anyformat (a_boolean: BOOLEAN)

-- Force the video subsystem to display
-- a surface even if it's bpp is not available.

ensure
anyformat_set: anyformat = a_boolean
set_async_blit (a_boolean: BOOLEAN)

-- Does the video subsystem use asynchronous blits if it is possible.
-- This can speed up blitting on multiple CPU machines or SMP systems.

ensure
async_blit_set: async_blit = a_boolean
set_doublebuffered (a_boolean: BOOLEAN)

-- Use doublebuffering.

ensure
doublebuffered_set: doublebuffered = a_boolean
set_fullscreen (a_boolean: BOOLEAN)

-- Use fullscreen. This yields only good results if your
-- display server (Xserver or Graphics driver for example)
-- supports the format.
-- Example: You have a surface that mesures 800x600 pixels
-- and your display server supports 800x600 as a resolution.
-- Counter example: You have a 700x500 surface, but your
-- display server only supports 800x600, the surface will be displayed
-- but there will be an edge around the surface that won't be accessible.

ensure
fullscreen_set: fullscreen = a_boolean
set_hardware_surface (a_boolean: BOOLEAN)

-- Is the displayed surface in video memory.

ensure
hardware_surface_set: hardware_surface = a_boolean
set_hwpalette (a_boolean: BOOLEAN)

-- Grant the video subsystem access to the hardware palette.

ensure
hwpalette_set: hwpalette = a_boolean
set_noframe (a_boolean: BOOLEAN)

-- Display the surface without frame.
-- Note: Fullscreen mode have this flag set
-- automatically.

ensure
noframe_set: noframe = a_boolean
set_opengl (a_boolean: BOOLEAN)

-- Enable OpenGL without video attributes.

ensure
opengl_set: opengl = a_boolean
set_resizeable (a_boolean: BOOLEAN)

-- Create a resizeable window. When the window is
-- resizes an resize_event is fired and the
-- sdl_set_video_mode_external can be set with the new size.
-- You will need to register an event handler in the event loop
-- in order to do this.

ensure
resizeable_set: resizeable = a_boolean
set_software_surface (a_boolean: BOOLEAN)

-- Is the displayed surface in system memory.

ensure
no_double_buffering: doublebuffered = False
software_surface_set: software_surface = a_boolean
software_surface: BOOLEAN

-- Is the displayed surface in system memory?

feature -- Video subsystem OpenGL binding-- this are the attributes for the openGL mode

gl_accum_alpha_size: INTEGER

-- Alpha accumulator size

gl_accum_blue_size: INTEGER

-- Blue accumulator size

gl_accum_green_size: INTEGER

-- Green accumulator size

gl_accum_red_size: INTEGER

-- Red accumulator size

gl_alpha_size: INTEGER

-- Alpha framebuffer size

gl_blue_size: INTEGER

-- Blue framebuffer size

gl_buffer_size: INTEGER

-- Framebuffer size

gl_depth_size: INTEGER

-- Depth buffer size

gl_green_size: INTEGER

-- Green framebuffer size

gl_red_size: INTEGER

-- Red framebuffer size

gl_set_buffer_size ( an_integer: INTEGER )

-- Set framebuffer size.

ensure
gl_buffer_size_set: gl_buffer_size = an_integer
gl_set_color_size_accum ( r: INTEGER; g: INTEGER; b: INTEGER; a: INTEGER)

-- Set accumulator color sizes.

ensure
gl_accum_red_size_set: gl_accum_red_size = r
gl_accum_green_size_set: gl_accum_green_size = g
gl_accum_blue_size_set: gl_accum_blue_size = b
gl_accum_alpha_size_set: gl_accum_alpha_size = a
gl_set_color_size_framebuffer ( r: INTEGER; g: INTEGER; b: INTEGER; a: INTEGER)

-- Set framebuffer color sizes.

ensure
gl_red_size_set: gl_red_size = r
gl_green_size_set: gl_green_size = g
gl_blue_size_set: gl_blue_size = b
gl_alpha_size_set: gl_alpha_size = a
gl_set_depth_size ( an_integer: INTEGER )

-- Set depth buffer size.

ensure
gl_depth_size_set: gl_depth_size = an_integer
gl_set_stencil_size ( an_integer: INTEGER )

-- Set stencil buffer size.

ensure
gl_stencil_size_set: gl_stencil_size = an_integer
gl_stencil_size: INTEGER

-- Stencil buffer size

opengl_enabled: BOOLEAN

-- Is the OpenGL mode activated?

invariant

valid_video_surface: is_enabled implies (video_surface /= Void)

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end