Back to index

libsfml  1.6+dfsg2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
sf::priv::WindowImplXXX Class Reference

WindowImplXXX is the XXX implementation of WindowImpl /////////////////////////////////////////////////////////. More...

#include <WindowImplXXX.hpp>

Inheritance diagram for sf::priv::WindowImplXXX:
Inheritance graph
[legend]
Collaboration diagram for sf::priv::WindowImplXXX:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 WindowImplXXX ()
 Default constructor (creates a dummy window to provide a valid OpenGL context)
 WindowImplXXX (WindowHandle Handle, WindowSettings &Params)
 Construct the window implementation from an existing control.
 WindowImplXXX (VideoMode Mode, const std::string &Title, unsigned long WindowStyle, WindowSettings &Params)
 Create the window implementation.
 ~WindowImplXXX ()
 Destructor.
void AddListener (WindowListener *Listener)
 Add a listener to the window.
void RemoveListener (WindowListener *Listener)
 Remove a listener from the window.
void Initialize ()
 Initialize window's states that can't be done at construction.
unsigned int GetWidth () const
 Get the client width of the window.
unsigned int GetHeight () const
 Get the client height of the window.
void SetJoystickThreshold (float Threshold)
 Change the joystick threshold, ie. the value below which no move event will be generated.
void DoEvents ()
 Process incoming events from operating system.

Static Public Member Functions

static bool IsContextActive ()
 Check if there's an active context on the current thread.
static WindowImplNew ()
 Create a new window depending on the current OS.
static WindowImplNew (VideoMode Mode, const std::string &Title, unsigned long WindowStyle, WindowSettings &Params)
 Create a new window depending on the current OS.
static WindowImplNew (WindowHandle Handle, WindowSettings &Params)
 Create a new window depending on to the current OS.

Protected Member Functions

void SendEvent (const Event &EventToSend)
 Send an event to listeners (for derived classes only)

Static Protected Member Functions

static int EvaluateConfig (const VideoMode &Mode, const WindowSettings &Settings, int ColorBits, int DepthBits, int StencilBits, int Antialiasing)
 Evaluate a pixel format configuration. This functions can be used by implementations that have several valid formats and want to get the best one.

Protected Attributes

unsigned int myWidth
 Internal width of the window.
unsigned int myHeight
 Internal height of the window.

Private Member Functions

virtual void Display ()
 /see WindowImpl::Display
virtual void ProcessEvents ()
 /see WindowImpl::ProcessEvents
virtual void SetActive (bool Active=true) const
 /see WindowImpl::SetActive
virtual bool IsActive () const
 /see WindowImpl::IsActive
virtual void UseVerticalSync (bool Enabled)
 /see WindowImpl::UseVerticalSync
virtual void ShowMouseCursor (bool Show)
 /see WindowImpl::ShowMouseCursor
virtual void SetCursorPosition (unsigned int Left, unsigned int Top)
 /see WindowImpl::SetCursorPosition
virtual void SetPosition (int Left, int Top)
 /see WindowImpl::SetPosition
virtual void SetSize (unsigned int Width, unsigned int Height)
 /see WindowImpl::SetSize
virtual void Show (bool State)
 /see WindowImpl::Show
virtual void EnableKeyRepeat (bool Enabled)
 /see WindowImpl::EnableKeyRepeat
virtual void SetIcon (unsigned int Width, unsigned int Height, const Uint8 *Pixels)
 /see WindowImpl::SetIcon

Detailed Description

WindowImplXXX is the XXX implementation of WindowImpl /////////////////////////////////////////////////////////.

Definition at line 43 of file WindowImplXXX.hpp.


Constructor & Destructor Documentation

Default constructor (creates a dummy window to provide a valid OpenGL context)

Default constructor (creates a dummy window to provide a valid OpenGL context) /////////////////////////////////////////////////////////.

/////////////////////////////////////////////////////////

Definition at line 41 of file WindowImplXXX.cpp.

{
    // Create a dummy window (with the fewest attributes -- it's just to have a valid support for an OpenGL context)

    // Initialize myWidth and myHeight members from base class with the window size

    // Create an OpenGL context in this window and DO NOT make it active
}
sf::priv::WindowImplXXX::WindowImplXXX ( WindowHandle  Handle,
WindowSettings Params 
)

Construct the window implementation from an existing control.

Create the window implementation from an existing control /////////////////////////////////////////////////////////.

Parameters:
Handle: Platform-specific handle of the control
Params: Creation parameters

/////////////////////////////////////////////////////////

Definition at line 54 of file WindowImplXXX.cpp.

{
    // Make sure we'll be able to catch all the events of the given window

    // Initialize myWidth and myHeight members from base class with the window size

    // Create an OpenGL context in this window and make it active
}
sf::priv::WindowImplXXX::WindowImplXXX ( VideoMode  Mode,
const std::string &  Title,
unsigned long  WindowStyle,
WindowSettings Params 
)

Create the window implementation.

Create the window implementation /////////////////////////////////////////////////////////.

Parameters:
Mode: Video mode to use
Title: Title of the window
WindowStyle: Window style
Params: Creation parameters

/////////////////////////////////////////////////////////

Definition at line 67 of file WindowImplXXX.cpp.

                                                                                                                      :
{
    // Create a new window with given size, title and style

    // Initialize myWidth and myHeight members from base class with the window size

    // Create an OpenGL context in this window and make it active
}

Destructor.

Destructor /////////////////////////////////////////////////////////.

/////////////////////////////////////////////////////////

Definition at line 80 of file WindowImplXXX.cpp.

{
    // Destroy the OpenGL context, the window and every resource allocated by this class
}

Member Function Documentation

void sf::priv::WindowImpl::AddListener ( WindowListener *  Listener) [inherited]

Add a listener to the window.

Add a listener to the window /////////////////////////////////////////////////////////.

Parameters:
Listener: Listener to add

/////////////////////////////////////////////////////////

Definition at line 106 of file WindowImpl.cpp.

{
    if (Listener)
        myListeners.insert(Listener);
}
void sf::priv::WindowImplXXX::Display ( ) [private, virtual]

/see WindowImpl::Display

/see WindowImpl::Display /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 98 of file WindowImplXXX.cpp.

{
    // Swap OpenGL buffers (should be a call to xxxSwapBuffers)
}
void sf::priv::WindowImpl::DoEvents ( ) [inherited]

Process incoming events from operating system.

Process incoming events from operating system /////////////////////////////////////////////////////////.

/////////////////////////////////////////////////////////

Definition at line 167 of file WindowImpl.cpp.

{
    // Read the joysticks state and generate the appropriate events
    ProcessJoystickEvents();

    // Let the derived class process other events
    ProcessEvents();
}

Here is the call graph for this function:

void sf::priv::WindowImplXXX::EnableKeyRepeat ( bool  Enabled) [private, virtual]

/see WindowImpl::EnableKeyRepeat

/see WindowImpl::EnableKeyRepeat /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 181 of file WindowImplXXX.cpp.

{
    // Enable or disable automatic key-repeat for keydown events
}
int sf::priv::WindowImpl::EvaluateConfig ( const VideoMode &  Mode,
const WindowSettings Settings,
int  ColorBits,
int  DepthBits,
int  StencilBits,
int  Antialiasing 
) [static, protected, inherited]

Evaluate a pixel format configuration. This functions can be used by implementations that have several valid formats and want to get the best one.

Evaluate a pixel format configuration. This functions can be used by implementations that have several valid formats and want to get the best one /////////////////////////////////////////////////////////.

Parameters:
Mode: Requested video mode
Settings: Requested additionnal settings
ColorBits: Color bits of the configuration to evaluate
DepthBits: Depth bits of the configuration to evaluate
StencilBits: Stencil bits of the configuration to evaluate
Antialiasing: Antialiasing level of the configuration to evaluate
Returns:
Score of the configuration : the lower the better

/////////////////////////////////////////////////////////

Definition at line 203 of file WindowImpl.cpp.

{
    return abs(static_cast<int>(Mode.BitsPerPixel          - ColorBits))   +
           abs(static_cast<int>(Settings.DepthBits         - DepthBits))   +
           abs(static_cast<int>(Settings.StencilBits       - StencilBits)) +
           abs(static_cast<int>(Settings.AntialiasingLevel - Antialiasing));
}

Here is the caller graph for this function:

unsigned int sf::priv::WindowImpl::GetHeight ( ) const [inherited]

Get the client height of the window.

Get the client height of the window /////////////////////////////////////////////////////////.

Returns:
Height of the window in pixels

/////////////////////////////////////////////////////////

Definition at line 148 of file WindowImpl.cpp.

{
    return myHeight;
}
unsigned int sf::priv::WindowImpl::GetWidth ( ) const [inherited]

Get the client width of the window.

Get the client width of the window /////////////////////////////////////////////////////////.

Returns:
Width of the window in pixels

/////////////////////////////////////////////////////////

Definition at line 139 of file WindowImpl.cpp.

{
    return myWidth;
}
void sf::priv::WindowImpl::Initialize ( ) [inherited]

Initialize window's states that can't be done at construction.

Initialize window's states that can't be done at construction /////////////////////////////////////////////////////////.

/////////////////////////////////////////////////////////

Reimplemented in sf::priv::WindowImplX11.

Definition at line 125 of file WindowImpl.cpp.

{
    // Initialize the joysticks
    for (unsigned int i = 0; i < Joy::Count; ++i)
    {
        myJoysticks[i].Initialize(i);
        myJoyStates[i] = myJoysticks[i].UpdateState();
    }
}

Here is the call graph for this function:

virtual bool sf::priv::WindowImplXXX::IsActive ( ) const [private, virtual]

/see WindowImpl::IsActive

/////////////////////////////////////////////////////////

Check if there's an active context on the current thread.

Check if there's an active context on the current thread /////////////////////////////////////////////////////////.

Returns:
True if there's a context bound to the current thread

/////////////////////////////////////////////////////////

Reimplemented from sf::priv::WindowImpl.

Definition at line 89 of file WindowImplXXX.cpp.

{
    // Should return whether xxxGetCurrentContext() is NULL or not;
}
WindowImpl * sf::priv::WindowImpl::New ( ) [static, inherited]

Create a new window depending on the current OS.

Create a new window depending on the current OS /////////////////////////////////////////////////////////.

Returns:
Pointer to the created window

/////////////////////////////////////////////////////////

Definition at line 59 of file WindowImpl.cpp.

{
    return new WindowImplType();
}
WindowImpl * sf::priv::WindowImpl::New ( VideoMode  Mode,
const std::string &  Title,
unsigned long  WindowStyle,
WindowSettings Params 
) [static, inherited]

Create a new window depending on the current OS.

Create a new window depending on the current OS /////////////////////////////////////////////////////////.

Parameters:
Mode: Video mode to use
Title: Title of the window
WindowStyle: Window style
Params: Creation parameters
Returns:
Pointer to the created window

/////////////////////////////////////////////////////////

Definition at line 68 of file WindowImpl.cpp.

{
    return new WindowImplType(Mode, Title, WindowStyle, Params);
}
WindowImpl * sf::priv::WindowImpl::New ( WindowHandle  Handle,
WindowSettings Params 
) [static, inherited]

Create a new window depending on to the current OS.

Create a new window depending on the current OS /////////////////////////////////////////////////////////.

Parameters:
Handle: Platform-specific handle of the control
Params: Creation parameters
Returns:
Pointer to the created window

/////////////////////////////////////////////////////////

Definition at line 77 of file WindowImpl.cpp.

{
    return new WindowImplType(Handle, Params);
}
void sf::priv::WindowImplXXX::ProcessEvents ( ) [private, virtual]

/see WindowImpl::ProcessEvents

/see WindowImpl::ProcessEvents /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 107 of file WindowImplXXX.cpp.

{
    // Process every event for this window

    // Generate a sf::Event and call SendEvent(Evt) for each event
}
void sf::priv::WindowImpl::RemoveListener ( WindowListener *  Listener) [inherited]

Remove a listener from the window.

Remove a listener from the window /////////////////////////////////////////////////////////.

Parameters:
Listener: Listener to remove

/////////////////////////////////////////////////////////

Definition at line 116 of file WindowImpl.cpp.

{
    myListeners.erase(Listener);
}
void sf::priv::WindowImpl::SendEvent ( const Event EventToSend) [protected, inherited]

Send an event to listeners (for derived classes only)

Send an event to listeners /////////////////////////////////////////////////////////.

Parameters:
EventToSend: Event to send

/////////////////////////////////////////////////////////

Definition at line 189 of file WindowImpl.cpp.

{
    for (std::set<WindowListener*>::iterator i = myListeners.begin(); i != myListeners.end(); ++i)
    {
        (*i)->OnEvent(EventToSend);
    }
}

Here is the caller graph for this function:

void sf::priv::WindowImplXXX::SetActive ( bool  Active = true) const [private, virtual]

/see WindowImpl::SetActive

/see WindowImpl::SetActive /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 118 of file WindowImplXXX.cpp.

{
    // Bind / unbind OpenGL context (should be a call to xxxMakeCurrent)
}
void sf::priv::WindowImplXXX::SetCursorPosition ( unsigned int  Left,
unsigned int  Top 
) [private, virtual]

/see WindowImpl::SetCursorPosition

/see WindowImpl::SetCursorPosition /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 146 of file WindowImplXXX.cpp.

{
    // Change the cursor position (Left and Top are relative to this window)
}
void sf::priv::WindowImplXXX::SetIcon ( unsigned int  Width,
unsigned int  Height,
const Uint8 *  Pixels 
) [private, virtual]

/see WindowImpl::SetIcon

/see WindowImpl::SetIcon /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 190 of file WindowImplXXX.cpp.

{
    // Change all the necessary icons of the window (titlebar, task bar, ...) with the
    // provided array of 32 bits RGBA pixels
}
void sf::priv::WindowImpl::SetJoystickThreshold ( float  Threshold) [inherited]

Change the joystick threshold, ie. the value below which no move event will be generated.

Change the joystick threshold, ie. the value below which no move event will be generated /////////////////////////////////////////////////////////.

Parameters:
Threshold: New threshold, in range [0, 100]

/////////////////////////////////////////////////////////

Definition at line 158 of file WindowImpl.cpp.

{
    myJoyThreshold = Threshold;
}
void sf::priv::WindowImplXXX::SetPosition ( int  Left,
int  Top 
) [private, virtual]

/see WindowImpl::SetPosition

/see WindowImpl::SetPosition /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 155 of file WindowImplXXX.cpp.

{
    // Change the window position
}
virtual void sf::priv::WindowImplXXX::SetSize ( unsigned int  Width,
unsigned int  Height 
) [private, virtual]

/see WindowImpl::SetSize

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

void sf::priv::WindowImplXXX::Show ( bool  State) [private, virtual]

/see WindowImpl::Show

/see WindowImpl::Show /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 173 of file WindowImplXXX.cpp.

{
    // Show or hide the window
}
void sf::priv::WindowImplXXX::ShowMouseCursor ( bool  Show) [private, virtual]

/see WindowImpl::ShowMouseCursor

/see WindowImpl::ShowMouseCursor /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 137 of file WindowImplXXX.cpp.

{
    // Show or hide the system cursor in this window
}
void sf::priv::WindowImplXXX::UseVerticalSync ( bool  Enabled) [private, virtual]

/see WindowImpl::UseVerticalSync

/see WindowImpl::UseVerticalSync /////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////

Implements sf::priv::WindowImpl.

Definition at line 127 of file WindowImplXXX.cpp.

{
    // Activate / deactivate vertical synchronization
    // usually using an OpenGL extension (should be a call to xxxSwapInterval)
}

Member Data Documentation

unsigned int sf::priv::WindowImpl::myHeight [protected, inherited]

Internal height of the window.

Definition at line 277 of file WindowImpl.hpp.

unsigned int sf::priv::WindowImpl::myWidth [protected, inherited]

Internal width of the window.

Definition at line 276 of file WindowImpl.hpp.


The documentation for this class was generated from the following files: