Fixed compile errors on Linux
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1168 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
1bf35973be
commit
1ce18ed1b9
@ -132,7 +132,7 @@ inline Out Unicode::UTF8ToUTF16(In begin, In end, Out output, Uint16 replacement
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Valid character directly convertible to 16 bits
|
// Valid character directly convertible to 16 bits
|
||||||
*Output++ = static_cast<Uint16>(character);
|
*output++ = static_cast<Uint16>(character);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (character > 0x0010FFFF)
|
else if (character > 0x0010FFFF)
|
||||||
|
@ -169,7 +169,7 @@ Vector3<T>& operator /=(Vector3<T>& left, T right)
|
|||||||
/// Operator == overload ; compares the equality of two vectors
|
/// Operator == overload ; compares the equality of two vectors
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool operator ==(const Vector3<T>& left, const Vector3<T>& V2)
|
bool operator ==(const Vector3<T>& left, const Vector3<T>& right)
|
||||||
{
|
{
|
||||||
return (left.x == right.x) && (left.y == right.y) && (left.z == right.z);
|
return (left.x == right.x) && (left.y == right.y) && (left.z == right.z);
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ int main()
|
|||||||
XSetWindowAttributes attributes;
|
XSetWindowAttributes attributes;
|
||||||
attributes.background_pixel = BlackPixel(display, screen);
|
attributes.background_pixel = BlackPixel(display, screen);
|
||||||
attributes.event_mask = KeyPressMask;
|
attributes.event_mask = KeyPressMask;
|
||||||
Window window = XCreateWindow(Disp, RootWindow(display, screen),
|
Window window = XCreateWindow(display, RootWindow(display, screen),
|
||||||
0, 0, 650, 330, 0,
|
0, 0, 650, 330, 0,
|
||||||
DefaultDepth(display, screen),
|
DefaultDepth(display, screen),
|
||||||
InputOutput,
|
InputOutput,
|
||||||
|
@ -146,7 +146,7 @@ bool RenderImageImplPBuffer::Create(unsigned int width, unsigned int height, uns
|
|||||||
glXMakeCurrent(myDisplay, NULL, NULL);
|
glXMakeCurrent(myDisplay, NULL, NULL);
|
||||||
|
|
||||||
// Create the context
|
// Create the context
|
||||||
XVisualInfo* Visual = glXGetVisualFromFBConfig(myDisplay, configs[0]);
|
XVisualInfo* visual = glXGetVisualFromFBConfig(myDisplay, configs[0]);
|
||||||
myContext = glXCreateContext(myDisplay, visual, currentContext, true);
|
myContext = glXCreateContext(myDisplay, visual, currentContext, true);
|
||||||
if (!myContext)
|
if (!myContext)
|
||||||
{
|
{
|
||||||
@ -173,7 +173,7 @@ bool RenderImageImplPBuffer::Create(unsigned int width, unsigned int height, uns
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
bool RenderImageImplPBuffer::Activate(bool active)
|
bool RenderImageImplPBuffer::Activate(bool active)
|
||||||
{
|
{
|
||||||
if (Active)
|
if (active)
|
||||||
{
|
{
|
||||||
if (myPBuffer && myContext && (glXGetCurrentContext() != myContext))
|
if (myPBuffer && myContext && (glXGetCurrentContext() != myContext))
|
||||||
{
|
{
|
||||||
|
@ -193,10 +193,10 @@ void ContextGLX::CreateContext(ContextGLX* shared, unsigned int bitsPerPixel, co
|
|||||||
// Get all the visuals matching the template
|
// Get all the visuals matching the template
|
||||||
int nbVisuals = 0;
|
int nbVisuals = 0;
|
||||||
XVisualInfo* visuals = XGetVisualInfo(myDisplay.GetDisplay(), VisualDepthMask | VisualIDMask | VisualScreenMask, &tpl, &nbVisuals);
|
XVisualInfo* visuals = XGetVisualInfo(myDisplay.GetDisplay(), VisualDepthMask | VisualIDMask | VisualScreenMask, &tpl, &nbVisuals);
|
||||||
if (!Visuals || (NbVisuals == 0))
|
if (!visuals || (nbVisuals == 0))
|
||||||
{
|
{
|
||||||
if (Visuals)
|
if (visuals)
|
||||||
XFree(Visuals);
|
XFree(visuals);
|
||||||
std::cerr << "There is no valid visual for the selected screen" << std::endl;
|
std::cerr << "There is no valid visual for the selected screen" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ void VideoModeSupport::GetSupportedVideoModes(std::vector<VideoMode>& modes)
|
|||||||
|
|
||||||
// Check if the XRandR extension is present
|
// Check if the XRandR extension is present
|
||||||
int version;
|
int version;
|
||||||
if (XQueryExtension(Disp.GetDisplay(), "RANDR", &version, &version, &version))
|
if (XQueryExtension(disp.GetDisplay(), "RANDR", &version, &version, &version))
|
||||||
{
|
{
|
||||||
// Get the current configuration
|
// Get the current configuration
|
||||||
XRRScreenConfiguration* config = XRRGetScreenInfo(disp.GetDisplay(), RootWindow(disp.GetDisplay(), screen));
|
XRRScreenConfiguration* config = XRRGetScreenInfo(disp.GetDisplay(), RootWindow(disp.GetDisplay(), screen));
|
||||||
@ -125,7 +125,7 @@ VideoMode VideoModeSupport::GetDesktopVideoMode()
|
|||||||
|
|
||||||
// Get the available screen sizes
|
// Get the available screen sizes
|
||||||
int nbSizes;
|
int nbSizes;
|
||||||
XRRScreenSize* sizes = XRRConfigSizes(Config, &nbSizes);
|
XRRScreenSize* sizes = XRRConfigSizes(config, &nbSizes);
|
||||||
if (sizes && (nbSizes > 0))
|
if (sizes && (nbSizes > 0))
|
||||||
desktopMode = VideoMode(sizes[currentMode].width, sizes[currentMode].height, DefaultDepth(disp.GetDisplay(), screen));
|
desktopMode = VideoMode(sizes[currentMode].width, sizes[currentMode].height, DefaultDepth(disp.GetDisplay(), screen));
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ myKeyRepeat (true)
|
|||||||
myHeight = windowAttributes.height;
|
myHeight = windowAttributes.height;
|
||||||
|
|
||||||
// Make sure the window is listening to all the requiered events
|
// Make sure the window is listening to all the requiered events
|
||||||
XSelectInput(myDisplay, myWindow, EventMask & ~ButtonPressMask);
|
XSelectInput(myDisplay, myWindow, eventMask & ~ButtonPressMask);
|
||||||
|
|
||||||
// Do some common initializations
|
// Do some common initializations
|
||||||
Initialize();
|
Initialize();
|
||||||
@ -560,7 +560,7 @@ void WindowImplX11::CreateHiddenCursor()
|
|||||||
// Create the cursor, using the pixmap as both the shape and the mask of the cursor
|
// Create the cursor, using the pixmap as both the shape and the mask of the cursor
|
||||||
XColor color;
|
XColor color;
|
||||||
color.flags = DoRed | DoGreen | DoBlue;
|
color.flags = DoRed | DoGreen | DoBlue;
|
||||||
color.red = Color.blue = Color.green = 0;
|
color.red = color.blue = color.green = 0;
|
||||||
myHiddenCursor = XCreatePixmapCursor(myDisplay, cursorPixmap, cursorPixmap, &color, &color, 0, 0);
|
myHiddenCursor = XCreatePixmapCursor(myDisplay, cursorPixmap, cursorPixmap, &color, &color, 0, 0);
|
||||||
|
|
||||||
// We don't need the pixmap any longer, free it
|
// We don't need the pixmap any longer, free it
|
||||||
@ -759,7 +759,7 @@ void WindowImplX11::ProcessEvent(XEvent windowEvent)
|
|||||||
event.Type = Event::MouseButtonPressed;
|
event.Type = Event::MouseButtonPressed;
|
||||||
event.MouseButton.X = windowEvent.xbutton.x;
|
event.MouseButton.X = windowEvent.xbutton.x;
|
||||||
event.MouseButton.Y = windowEvent.xbutton.y;
|
event.MouseButton.Y = windowEvent.xbutton.y;
|
||||||
switch (Button)
|
switch (button)
|
||||||
{
|
{
|
||||||
case Button1 : event.MouseButton.Button = Mouse::Left; break;
|
case Button1 : event.MouseButton.Button = Mouse::Left; break;
|
||||||
case Button2 : event.MouseButton.Button = Mouse::Middle; break;
|
case Button2 : event.MouseButton.Button = Mouse::Middle; break;
|
||||||
@ -782,7 +782,7 @@ void WindowImplX11::ProcessEvent(XEvent windowEvent)
|
|||||||
event.Type = Event::MouseButtonReleased;
|
event.Type = Event::MouseButtonReleased;
|
||||||
event.MouseButton.X = windowEvent.xbutton.x;
|
event.MouseButton.X = windowEvent.xbutton.x;
|
||||||
event.MouseButton.Y = windowEvent.xbutton.y;
|
event.MouseButton.Y = windowEvent.xbutton.y;
|
||||||
switch (Button)
|
switch (button)
|
||||||
{
|
{
|
||||||
case Button1 : event.MouseButton.Button = Mouse::Left; break;
|
case Button1 : event.MouseButton.Button = Mouse::Left; break;
|
||||||
case Button2 : event.MouseButton.Button = Mouse::Middle; break;
|
case Button2 : event.MouseButton.Button = Mouse::Middle; break;
|
||||||
|
Loading…
Reference in New Issue
Block a user