Added the trunk/branches/tags directories at repository root, and moved previous root into trunk/
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1002 4e206d99-4929-0410-ac5d-dfc041789085
79
samples/Makefile
Normal file
|
@ -0,0 +1,79 @@
|
|||
export DEBUGBUILD = no
|
||||
ifeq ($(DEBUGBUILD), yes)
|
||||
DEBUGFLAGS = -g -DDEBUG
|
||||
else
|
||||
DEBUGFLAGS = -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
export CC = g++
|
||||
export CFLAGS = -W -Wall -ansi -I../../include $(DEBUGFLAGS)
|
||||
export LDFLAGS =
|
||||
export EXECPATH = ../bin
|
||||
|
||||
all: ftp-sample opengl-sample pong-sample post-fx-sample qt-sample sockets-sample sound-sample sound_capture-sample voip-sample window-sample wxwidgets-sample X11-sample
|
||||
|
||||
ftp-sample:
|
||||
@(cd ./ftp && $(MAKE))
|
||||
|
||||
opengl-sample:
|
||||
@(cd ./opengl && $(MAKE))
|
||||
|
||||
pong-sample:
|
||||
@(cd ./pong && $(MAKE))
|
||||
|
||||
post-fx-sample:
|
||||
@(cd ./post-fx && $(MAKE))
|
||||
|
||||
qt-sample:
|
||||
@(cd ./qt && $(MAKE))
|
||||
|
||||
sockets-sample:
|
||||
@(cd ./sockets && $(MAKE))
|
||||
|
||||
sound-sample:
|
||||
@(cd ./sound && $(MAKE))
|
||||
|
||||
sound_capture-sample:
|
||||
@(cd ./sound_capture && $(MAKE))
|
||||
|
||||
voip-sample:
|
||||
@(cd ./voip && $(MAKE))
|
||||
|
||||
window-sample:
|
||||
@(cd ./window && $(MAKE))
|
||||
|
||||
wxwidgets-sample:
|
||||
@(cd ./wxwidgets && $(MAKE))
|
||||
|
||||
X11-sample:
|
||||
@(cd ./X11 && $(MAKE))
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@(cd ./ftp && $(MAKE) $@ && \
|
||||
cd ../opengl && $(MAKE) $@ && \
|
||||
cd ../pong && $(MAKE) $@ && \
|
||||
cd ../post-fx && $(MAKE) $@ && \
|
||||
cd ../qt && $(MAKE) $@ && \
|
||||
cd ../sockets && $(MAKE) $@ && \
|
||||
cd ../sound && $(MAKE) $@ && \
|
||||
cd ../sound_capture && $(MAKE) $@ && \
|
||||
cd ../voip && $(MAKE) $@ && \
|
||||
cd ../window && $(MAKE) $@ && \
|
||||
cd ../wxwidgets && $(MAKE) $@ && \
|
||||
cd ../X11 && $(MAKE) $@)
|
||||
|
||||
mrproper: clean
|
||||
@(cd ./ftp && $(MAKE) $@ && \
|
||||
cd ../opengl && $(MAKE) $@ && \
|
||||
cd ../pong && $(MAKE) $@ && \
|
||||
cd ../post-fx && $(MAKE) $@ && \
|
||||
cd ../qt && $(MAKE) $@ && \
|
||||
cd ../sockets && $(MAKE) $@ && \
|
||||
cd ../sound && $(MAKE) $@ && \
|
||||
cd ../sound_capture && $(MAKE) $@ && \
|
||||
cd ../voip && $(MAKE) $@ && \
|
||||
cd ../window && $(MAKE) $@ && \
|
||||
cd ../wxwidgets && $(MAKE) $@ && \
|
||||
cd ../X11 && $(MAKE) $@)
|
18
samples/X11/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = X11
|
||||
OBJ = X11.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
X11: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-window -lsfml-system -lGLU -lGL -lX11
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
212
samples/X11/X11.cpp
Normal file
|
@ -0,0 +1,212 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window.hpp>
|
||||
#include <X11/Xlib.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Initialize OpenGL states into the specified view
|
||||
///
|
||||
/// \param Window : Target window to initialize
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void Initialize(sf::Window& Window)
|
||||
{
|
||||
// Activate the window
|
||||
Window.SetActive();
|
||||
|
||||
// Setup OpenGL states
|
||||
// Set color and depth clear value
|
||||
glClearDepth(1.f);
|
||||
glClearColor(0.f, 0.5f, 0.5f, 0.f);
|
||||
|
||||
// Enable Z-buffer read and write
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_TRUE);
|
||||
|
||||
// Setup a perspective projection
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(90.f, 1.f, 1.f, 500.f);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Draw the OpenGL scene (a rotating cube) into
|
||||
/// the specified view
|
||||
///
|
||||
/// \param Window : Target window for rendering
|
||||
/// \param ElapsedTime : Time elapsed since the last draw
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void Draw(sf::Window& Window, float ElapsedTime)
|
||||
{
|
||||
// Activate the window
|
||||
Window.SetActive();
|
||||
|
||||
// Clear color and depth buffers
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Apply some transformations
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.f, 0.f, -200.f);
|
||||
glRotatef(ElapsedTime * 50, 1.f, 0.f, 0.f);
|
||||
glRotatef(ElapsedTime * 30, 0.f, 1.f, 0.f);
|
||||
glRotatef(ElapsedTime * 90, 0.f, 0.f, 1.f);
|
||||
|
||||
// Draw a cube
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
glColor3f(1.f, 1.f, 0.f);
|
||||
glVertex3f(-50.f, -50.f, -50.f);
|
||||
glVertex3f(-50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, -50.f, -50.f);
|
||||
|
||||
glColor3f(1.f, 1.f, 0.f);
|
||||
glVertex3f(-50.f, -50.f, 50.f);
|
||||
glVertex3f(-50.f, 50.f, 50.f);
|
||||
glVertex3f( 50.f, 50.f, 50.f);
|
||||
glVertex3f( 50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(0.f, 1.f, 1.f);
|
||||
glVertex3f(-50.f, -50.f, -50.f);
|
||||
glVertex3f(-50.f, 50.f, -50.f);
|
||||
glVertex3f(-50.f, 50.f, 50.f);
|
||||
glVertex3f(-50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(0.f, 1.f, 1.f);
|
||||
glVertex3f(50.f, -50.f, -50.f);
|
||||
glVertex3f(50.f, 50.f, -50.f);
|
||||
glVertex3f(50.f, 50.f, 50.f);
|
||||
glVertex3f(50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(1.f, 0.f, 1.f);
|
||||
glVertex3f(-50.f, -50.f, 50.f);
|
||||
glVertex3f(-50.f, -50.f, -50.f);
|
||||
glVertex3f( 50.f, -50.f, -50.f);
|
||||
glVertex3f( 50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(1.f, 0.f, 1.f);
|
||||
glVertex3f(-50.f, 50.f, 50.f);
|
||||
glVertex3f(-50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, 50.f, 50.f);
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Error code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Open a connection with the X server
|
||||
Display* Disp = XOpenDisplay(NULL);
|
||||
if (!Disp)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Setup OpenGL states
|
||||
// Set color and depth clear value
|
||||
glClearDepth(1.f);
|
||||
glClearColor(0.f, 0.5f, 0.5f, 0.f);
|
||||
|
||||
// Enable Z-buffer read and write
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_TRUE);
|
||||
|
||||
// Setup a perspective projection
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(90.f, 1.f, 1.f, 500.f);
|
||||
// Get the default screen
|
||||
int Screen = DefaultScreen(Disp);
|
||||
|
||||
// Let's create the main window
|
||||
XSetWindowAttributes Attributes;
|
||||
Attributes.background_pixel = BlackPixel(Disp, Screen);
|
||||
Attributes.event_mask = KeyPressMask;
|
||||
Window Win = XCreateWindow(Disp, RootWindow(Disp, Screen),
|
||||
0, 0, 650, 330, 0,
|
||||
DefaultDepth(Disp, Screen),
|
||||
InputOutput,
|
||||
DefaultVisual(Disp, Screen),
|
||||
CWBackPixel | CWEventMask, &Attributes);
|
||||
if (!Win)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Set the window's name
|
||||
XStoreName(Disp, Win, "SFML Window");
|
||||
|
||||
// Let's create the windows which will serve as containers for our SFML views
|
||||
Window View1 = XCreateWindow(Disp, Win,
|
||||
10, 10, 310, 310, 0,
|
||||
DefaultDepth(Disp, Screen),
|
||||
InputOutput,
|
||||
DefaultVisual(Disp, Screen),
|
||||
0, NULL);
|
||||
Window View2 = XCreateWindow(Disp, Win,
|
||||
330, 10, 310, 310, 0,
|
||||
DefaultDepth(Disp, Screen),
|
||||
InputOutput,
|
||||
DefaultVisual(Disp, Screen),
|
||||
0, NULL);
|
||||
|
||||
// Show our windows
|
||||
XMapWindow(Disp, Win);
|
||||
XFlush(Disp);
|
||||
|
||||
// Create our SFML views
|
||||
sf::Window SFMLView1(View1);
|
||||
sf::Window SFMLView2(View2);
|
||||
|
||||
// Create a clock for measuring elapsed time
|
||||
sf::Clock Clock;
|
||||
|
||||
// Initialize our views
|
||||
Initialize(SFMLView1);
|
||||
Initialize(SFMLView2);
|
||||
|
||||
// Start the event loop
|
||||
bool IsRunning = true;
|
||||
while (IsRunning)
|
||||
{
|
||||
while (XPending(Disp))
|
||||
{
|
||||
// Get the next pending event
|
||||
XEvent Event;
|
||||
XNextEvent(Disp, &Event);
|
||||
|
||||
// Process it
|
||||
switch (Event.type)
|
||||
{
|
||||
// Any key is pressed : quit
|
||||
case KeyPress :
|
||||
IsRunning = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw something into our views
|
||||
Draw(SFMLView1, Clock.GetElapsedTime());
|
||||
Draw(SFMLView2, Clock.GetElapsedTime() * 0.3f);
|
||||
|
||||
// Display the views on screen
|
||||
SFMLView1.Display();
|
||||
SFMLView2.Display();
|
||||
}
|
||||
|
||||
// Close the display
|
||||
XCloseDisplay(Disp);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
samples/bin/datas/opengl/background.jpg
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
samples/bin/datas/opengl/texture.jpg
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
samples/bin/datas/pong/background.jpg
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
samples/bin/datas/pong/ball.png
Normal file
After Width: | Height: | Size: 249 B |
BIN
samples/bin/datas/pong/ball.wav
Normal file
BIN
samples/bin/datas/pong/cheeseburger.ttf
Normal file
BIN
samples/bin/datas/pong/paddle_left.png
Normal file
After Width: | Height: | Size: 762 B |
BIN
samples/bin/datas/pong/paddle_right.png
Normal file
After Width: | Height: | Size: 683 B |
BIN
samples/bin/datas/post-fx/background.jpg
Normal file
After Width: | Height: | Size: 154 KiB |
16
samples/bin/datas/post-fx/blur.sfx
Normal file
|
@ -0,0 +1,16 @@
|
|||
texture framebuffer
|
||||
float offset
|
||||
|
||||
effect
|
||||
{
|
||||
vec2 offx = vec2(offset, 0.0);
|
||||
vec2 offy = vec2(0.0, offset);
|
||||
|
||||
vec4 c0 = framebuffer(_in);
|
||||
vec4 c1 = framebuffer(_in - offy);
|
||||
vec4 c2 = framebuffer(_in + offy);
|
||||
vec4 c3 = framebuffer(_in - offx);
|
||||
vec4 c4 = framebuffer(_in + offx);
|
||||
|
||||
_out = c0 * 0.2 + c1 * 0.2 + c2 * 0.2 + c3 * 0.2 + c4 * 0.2;
|
||||
}
|
BIN
samples/bin/datas/post-fx/cheeseburger.ttf
Normal file
10
samples/bin/datas/post-fx/colorize.sfx
Normal file
|
@ -0,0 +1,10 @@
|
|||
texture framebuffer
|
||||
vec3 color
|
||||
|
||||
effect
|
||||
{
|
||||
vec4 pixel = framebuffer(_in);
|
||||
float gray = pixel.r * 0.39 + pixel.g * 0.50 + pixel.b * 0.11;
|
||||
|
||||
_out = vec4(gray * color, 1.0) * 0.6 + pixel * 0.4;
|
||||
}
|
12
samples/bin/datas/post-fx/fisheye.sfx
Normal file
|
@ -0,0 +1,12 @@
|
|||
texture framebuffer
|
||||
vec2 mouse
|
||||
|
||||
effect
|
||||
{
|
||||
float len = distance(_in, mouse) * 7.0;
|
||||
|
||||
if (len < 1.0)
|
||||
_out = framebuffer(_in + (_in - mouse) * len);
|
||||
else
|
||||
_out = framebuffer(_in);
|
||||
}
|
6
samples/bin/datas/post-fx/nothing.sfx
Normal file
|
@ -0,0 +1,6 @@
|
|||
texture framebuffer
|
||||
|
||||
effect
|
||||
{
|
||||
_out = framebuffer(_in);
|
||||
}
|
BIN
samples/bin/datas/post-fx/wave.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
12
samples/bin/datas/post-fx/wave.sfx
Normal file
|
@ -0,0 +1,12 @@
|
|||
texture framebuffer
|
||||
texture wave
|
||||
vec2 offset
|
||||
|
||||
effect
|
||||
{
|
||||
vec2 texoffset = wave(_in * offset).xy;
|
||||
texoffset -= vec2(0.5, 0.5);
|
||||
texoffset *= 0.05;
|
||||
|
||||
_out = framebuffer(_in + texoffset);
|
||||
}
|
BIN
samples/bin/datas/qt/sfml.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
samples/bin/datas/sound/footsteps.wav
Normal file
BIN
samples/bin/datas/sound/lepidoptera.ogg
Normal file
BIN
samples/bin/datas/win32/image1.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
samples/bin/datas/win32/image2.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
samples/bin/datas/wxwidgets/sfml.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
samples/bin/libsndfile-1.dll
Normal file
BIN
samples/bin/openal32.dll
Normal file
59
samples/build/codeblocks/ftp.cbp
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="ftp" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\ftp-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\ftp\Debug_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-network-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\ftp.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\ftp\Release_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-network-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\ftp\Ftp.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
69
samples/build/codeblocks/opengl.cbp
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="opengl" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\opengl-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\opengl\Debug_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\opengl.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\opengl\Release_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\opengl\OpenGL.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
71
samples/build/codeblocks/pong.cbp
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="pong" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\pong-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\opengl\Debug_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\pong.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\opengl\Release_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\pong\Pong.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
65
samples/build/codeblocks/postfx.cbp
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="postfx" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\postfx-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\postfx\Debug_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\postfx.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\postfx\Release_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\post-fx\PostFX.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
94
samples/build/codeblocks/qt.cbp
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="qt" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\qt-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\qt\Debug_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-W" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="kernel32" />
|
||||
<Add library="user32" />
|
||||
<Add library="gdi32" />
|
||||
<Add library="comdlg32" />
|
||||
<Add library="winspool" />
|
||||
<Add library="winmm" />
|
||||
<Add library="shell32" />
|
||||
<Add library="comctl32" />
|
||||
<Add library="ole32" />
|
||||
<Add library="oleaut32" />
|
||||
<Add library="uuid" />
|
||||
<Add library="rpcrt4" />
|
||||
<Add library="advapi32" />
|
||||
<Add library="wsock32" />
|
||||
<Add library="qtcore4" />
|
||||
<Add library="qtgui4" />
|
||||
<Add library="qtmain" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\qt.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\qt\Release_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-W" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
<Add directory="..\..\..\src" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="kernel32" />
|
||||
<Add library="user32" />
|
||||
<Add library="gdi32" />
|
||||
<Add library="comdlg32" />
|
||||
<Add library="winspool" />
|
||||
<Add library="winmm" />
|
||||
<Add library="shell32" />
|
||||
<Add library="comctl32" />
|
||||
<Add library="ole32" />
|
||||
<Add library="oleaut32" />
|
||||
<Add library="uuid" />
|
||||
<Add library="rpcrt4" />
|
||||
<Add library="advapi32" />
|
||||
<Add library="wsock32" />
|
||||
<Add library="qtcore4" />
|
||||
<Add library="qtgui4" />
|
||||
<Add library="qtmain" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\qt\Main.cpp" />
|
||||
<Unit filename="..\..\qt\QSFMLCanvas.cpp" />
|
||||
<Unit filename="..\..\qt\QSFMLCanvas.hpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
61
samples/build/codeblocks/sockets.cbp
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="sockets" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\sockets-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\sockets\Debug_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-network-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\sockets.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\sockets\Release_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-network-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\sockets\Sockets.cpp" />
|
||||
<Unit filename="..\..\sockets\TCP.cpp" />
|
||||
<Unit filename="..\..\sockets\UDP.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
61
samples/build/codeblocks/sound-capture.cbp
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="sound-capture" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\sound-capture-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\sound-capture\Debug_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\sound-capture.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\sound-capture\Release_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\sound_capture\SoundCapture.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
61
samples/build/codeblocks/sound.cbp
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="sound" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\sound-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\sound\Debug_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\sound.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\sound\Release_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\sound\Sound.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
65
samples/build/codeblocks/voip.cbp
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="voip" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\voip-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\voip\Debug_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-network-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\voip.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\voip\Release_Win32" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-audio-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-network-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\voip\Client.cpp" />
|
||||
<Unit filename="..\..\voip\Server.cpp" />
|
||||
<Unit filename="..\..\voip\VoIP.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
63
samples/build/codeblocks/win32.cbp
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="win32" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\win32-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\win32\Debug_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-W" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\win32.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\win32\Release_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-graphics-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\win32\Win32.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
65
samples/build/codeblocks/window.cbp
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="window" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\window-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\window\Debug_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s-d.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s-d.a" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\window.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\window\Release_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="..\..\..\lib\mingw\libsfml-main.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-window-s.a" />
|
||||
<Add library="..\..\..\lib\mingw\libsfml-system-s.a" />
|
||||
<Add library="opengl32" />
|
||||
<Add library="glu32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\window\Window.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
89
samples/build/codeblocks/wxwidgets.cbp
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="wxwidgets" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug_Win32">
|
||||
<Option output="..\..\bin\wxwidgets-d.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\wxwidgets\Debug_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-g" />
|
||||
<Add option="-O0" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-D_DEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
<Add option="-D_CRT_SECURE_NO_DEPRECATE" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="kernel32" />
|
||||
<Add library="user32" />
|
||||
<Add library="gdi32" />
|
||||
<Add library="comdlg32" />
|
||||
<Add library="winspool" />
|
||||
<Add library="winmm" />
|
||||
<Add library="shell32" />
|
||||
<Add library="comctl32" />
|
||||
<Add library="ole32" />
|
||||
<Add library="oleaut32" />
|
||||
<Add library="uuid" />
|
||||
<Add library="rpcrt4" />
|
||||
<Add library="advapi32" />
|
||||
<Add library="wsock32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release_Win32">
|
||||
<Option output="..\..\bin\wxwidgets.exe" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="..\..\..\Temp\wxwidgets\Release_Win32" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O3" />
|
||||
<Add option="-Wall" />
|
||||
<Add option="-DWIN32" />
|
||||
<Add option="-DNDEBUG" />
|
||||
<Add option="-D_WINDOWS" />
|
||||
<Add option="-D_CRT_SECURE_NO_DEPRECATE" />
|
||||
</Compiler>
|
||||
<ResourceCompiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
<Add directory="..\..\..\extlibs" />
|
||||
</ResourceCompiler>
|
||||
<Linker>
|
||||
<Add library="kernel32" />
|
||||
<Add library="user32" />
|
||||
<Add library="gdi32" />
|
||||
<Add library="comdlg32" />
|
||||
<Add library="winspool" />
|
||||
<Add library="winmm" />
|
||||
<Add library="shell32" />
|
||||
<Add library="comctl32" />
|
||||
<Add library="ole32" />
|
||||
<Add library="oleaut32" />
|
||||
<Add library="uuid" />
|
||||
<Add library="rpcrt4" />
|
||||
<Add library="advapi32" />
|
||||
<Add library="wsock32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add directory="..\..\..\include" />
|
||||
</Compiler>
|
||||
<Unit filename="..\..\wxwidgets\Main.cpp" />
|
||||
<Unit filename="..\..\wxwidgets\wxSFMLCanvas.cpp" />
|
||||
<Unit filename="..\..\wxwidgets\wxSFMLCanvas.hpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
189
samples/build/vc2005/ftp.vcproj
Normal file
|
@ -0,0 +1,189 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="ftp"
|
||||
ProjectGUID="{7236920B-254C-43A3-9DC1-778B477226DF}"
|
||||
RootNamespace="ftp"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
FavorSizeOrSpeed="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
UseLibraryDependencyInputs="false"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\ftp\Ftp.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
191
samples/build/vc2005/opengl.vcproj
Normal file
|
@ -0,0 +1,191 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="opengl"
|
||||
ProjectGUID="{4CD9A872-16EF-4C53-81FC-C7E77E782718}"
|
||||
RootNamespace="opengl"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\opengl\OpenGL.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
185
samples/build/vc2005/pong.vcproj
Normal file
|
@ -0,0 +1,185 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="pong"
|
||||
ProjectGUID="{DDDE27DC-5568-43EE-BD0E-57C581F73EDE}"
|
||||
RootNamespace="pong"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\pong\Pong.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
189
samples/build/vc2005/postfx.vcproj
Normal file
|
@ -0,0 +1,189 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="postfx"
|
||||
ProjectGUID="{E8B7727D-2308-4ADC-90AE-D3F46798447D}"
|
||||
RootNamespace="postfx"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\post-fx\PostFX.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
202
samples/build/vc2005/qt.vcproj
Normal file
|
@ -0,0 +1,202 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="qt"
|
||||
ProjectGUID="{EAB1A0A4-8CCC-4A74-B3B5-9F60243581D2}"
|
||||
RootNamespace="qt"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4311;4312"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib qtcore4.lib qtgui4.lib qtmain.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
EnableIntrinsicFunctions="false"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
DisableSpecificWarnings="4311;4312"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib qtcore4.lib qtgui4.lib qtmain.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\qt\Main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\qt\QSFMLCanvas.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\qt\QSFMLCanvas.hpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
197
samples/build/vc2005/sockets.vcproj
Normal file
|
@ -0,0 +1,197 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="sockets"
|
||||
ProjectGUID="{E6ED898F-218E-4467-8B1D-92E393283E1B}"
|
||||
RootNamespace="sockets"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
FavorSizeOrSpeed="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
UseLibraryDependencyInputs="false"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\sockets\Sockets.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\sockets\TCP.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\sockets\UDP.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
190
samples/build/vc2005/sound-capture.vcproj
Normal file
|
@ -0,0 +1,190 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="sound-capture"
|
||||
ProjectGUID="{34EBDA13-AFA3-4AD9-AB64-2B2D40E09573}"
|
||||
RootNamespace="sound-capture"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
UseLibraryDependencyInputs="false"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\sound_capture\SoundCapture.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
190
samples/build/vc2005/sound.vcproj
Normal file
|
@ -0,0 +1,190 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="sound"
|
||||
ProjectGUID="{11E3764D-850E-4EDA-9823-F66383A11042}"
|
||||
RootNamespace="sound"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
UseLibraryDependencyInputs="false"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\sound\Sound.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
198
samples/build/vc2005/voip.vcproj
Normal file
|
@ -0,0 +1,198 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="voip"
|
||||
ProjectGUID="{4B169017-FFDD-4588-9658-6F1C9ABC6495}"
|
||||
RootNamespace="voip"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
UseLibraryDependencyInputs="false"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\voip\Client.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\voip\Server.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\voip\VoIP.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
197
samples/build/vc2005/win32.vcproj
Normal file
|
@ -0,0 +1,197 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="win32"
|
||||
ProjectGUID="{303EC049-639D-4F9C-9F33-D4B7F702275B}"
|
||||
RootNamespace="win32"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\win32\Win32.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
WarningLevel="3"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
190
samples/build/vc2005/window.vcproj
Normal file
|
@ -0,0 +1,190 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="window"
|
||||
ProjectGUID="{11E9ABEF-17A5-4FF7-91E5-994F34172F68}"
|
||||
RootNamespace="window"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
UseLibraryDependencyInputs="false"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib glu32.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\window\Window.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
200
samples/build/vc2005/wxwidgets.vcproj
Normal file
|
@ -0,0 +1,200 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="wxwidgets"
|
||||
ProjectGUID="{8B3B274A-B3B7-4C6B-8D4A-5334E2116830}"
|
||||
RootNamespace="wxwidgets"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName)-d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)..\..\Temp\$(ProjectName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
EnableIntrinsicFunctions="false"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\..\include""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib"
|
||||
OutputFile="$(ProjectDir)..\..\bin\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(IntDir)$(TargetName).pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="..\..\wxwidgets\Main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\wxwidgets\wxSFMLCanvas.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\wxwidgets\wxSFMLCanvas.hpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
24
samples/build/xcode/opengl-Info.plist
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
24
samples/build/xcode/pong-Info.plist
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
24
samples/build/xcode/post-fx-Info.plist
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
1384
samples/build/xcode/samples.xcodeproj/project.pbxproj
Normal file
24
samples/build/xcode/window-Info.plist
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
205
samples/ftp/Ftp.cpp
Normal file
|
@ -0,0 +1,205 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Network.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Print a FTP response into a standard output stream
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
std::ostream& operator <<(std::ostream& Stream, const sf::Ftp::Response& Response)
|
||||
{
|
||||
return Stream << Response.GetStatus() << Response.GetMessage();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Choose the server address
|
||||
sf::IPAddress Address;
|
||||
do
|
||||
{
|
||||
std::cout << "Enter the FTP server address : ";
|
||||
std::cin >> Address;
|
||||
}
|
||||
while (!Address.IsValid());
|
||||
|
||||
// Connect to the server
|
||||
sf::Ftp Server;
|
||||
sf::Ftp::Response ConnectResponse = Server.Connect(Address);
|
||||
std::cout << ConnectResponse << std::endl;
|
||||
if (!ConnectResponse.IsOk())
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Ask for user name and password
|
||||
std::string UserName, Password;
|
||||
std::cout << "User name : ";
|
||||
std::cin >> UserName;
|
||||
std::cout << "Password : ";
|
||||
std::cin >> Password;
|
||||
|
||||
// Login to the server
|
||||
sf::Ftp::Response LoginResponse = Server.Login(UserName, Password);
|
||||
std::cout << LoginResponse << std::endl;
|
||||
if (!LoginResponse.IsOk())
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Main menu
|
||||
int Choice = 0;
|
||||
do
|
||||
{
|
||||
// Main FTP menu
|
||||
std::cout << std::endl;
|
||||
std::cout << "Choose an action:" << std::endl;
|
||||
std::cout << "1. Print working directory" << std::endl;
|
||||
std::cout << "2. Print contents of working directory" << std::endl;
|
||||
std::cout << "3. Change directory" << std::endl;
|
||||
std::cout << "4. Create directory" << std::endl;
|
||||
std::cout << "5. Delete directory" << std::endl;
|
||||
std::cout << "6. Rename file" << std::endl;
|
||||
std::cout << "7. Remove file" << std::endl;
|
||||
std::cout << "8. Download file" << std::endl;
|
||||
std::cout << "9. Upload file" << std::endl;
|
||||
std::cout << "0. Disconnect" << std::endl;
|
||||
std::cout << std::endl;
|
||||
|
||||
std::cout << "Your choice: ";
|
||||
std::cin >> Choice;
|
||||
std::cout << std::endl;
|
||||
|
||||
switch (Choice)
|
||||
{
|
||||
default :
|
||||
{
|
||||
// Wrong choice
|
||||
std::cout << "Invalid choice!" << std::endl;
|
||||
std::cin.clear();
|
||||
std::cin.ignore(10000, '\n');
|
||||
break;
|
||||
}
|
||||
|
||||
case 1 :
|
||||
{
|
||||
// Print current server directory
|
||||
sf::Ftp::DirectoryResponse Response = Server.GetWorkingDirectory();
|
||||
std::cout << Response << std::endl;
|
||||
std::cout << "Current directory is " << Response.GetDirectory() << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 2 :
|
||||
{
|
||||
// Print content of current server directory
|
||||
sf::Ftp::ListingResponse Response = Server.GetDirectoryListing();
|
||||
std::cout << Response << std::endl;
|
||||
for (std::size_t i = 0; i < Response.GetCount(); ++i)
|
||||
std::cout << Response.GetFilename(i) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 3 :
|
||||
{
|
||||
// Change the current directory
|
||||
std::string Directory;
|
||||
std::cout << "Choose a directory: ";
|
||||
std::cin >> Directory;
|
||||
std::cout << Server.ChangeDirectory(Directory) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 4 :
|
||||
{
|
||||
// Create a new directory
|
||||
std::string Directory;
|
||||
std::cout << "Name of the directory to create: ";
|
||||
std::cin >> Directory;
|
||||
std::cout << Server.MakeDirectory(Directory) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 5 :
|
||||
{
|
||||
// Remove an existing directory
|
||||
std::string Directory;
|
||||
std::cout << "Name of the directory to remove: ";
|
||||
std::cin >> Directory;
|
||||
std::cout << Server.DeleteDirectory(Directory) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 6 :
|
||||
{
|
||||
// Rename a file
|
||||
std::string SrcFilename, DstFilename;
|
||||
std::cout << "Name of the file to rename: ";
|
||||
std::cin >> SrcFilename;
|
||||
std::cout << "New name: ";
|
||||
std::cin >> DstFilename;
|
||||
std::cout << Server.RenameFile(SrcFilename, DstFilename) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 7 :
|
||||
{
|
||||
// Remove an existing directory
|
||||
std::string Filename;
|
||||
std::cout << "Name of the file to remove: ";
|
||||
std::cin >> Filename;
|
||||
std::cout << Server.DeleteFile(Filename) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 8 :
|
||||
{
|
||||
// Download a file from server
|
||||
std::string Filename, Directory;
|
||||
std::cout << "Path of the file to download (relative to current directory): ";
|
||||
std::cin >> Filename;
|
||||
std::cout << "Directory to download the file to: ";
|
||||
std::cin >> Directory;
|
||||
std::cout << Server.Download(Filename, Directory) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 9 :
|
||||
{
|
||||
// Upload a file to server
|
||||
std::string Filename, Directory;
|
||||
std::cout << "Path of the file to upload (absolute or relative to working directory): ";
|
||||
std::cin >> Filename;
|
||||
std::cout << "Directory to upload the file to (relative to current directory): ";
|
||||
std::cin >> Directory;
|
||||
std::cout << Server.Upload(Filename, Directory) << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
case 0 :
|
||||
{
|
||||
// Disconnect
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} while (Choice != 0);
|
||||
|
||||
// Disconnect from the server
|
||||
std::cout << "Disconnecting from server..." << std::endl;
|
||||
std::cout << Server.Disconnect() << std::endl;
|
||||
|
||||
// Wait until the user presses 'enter' key
|
||||
std::cout << "Press enter to exit..." << std::endl;
|
||||
std::cin.ignore(10000, '\n');
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
samples/ftp/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = ftp
|
||||
OBJ = Ftp.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
ftp: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-network -lsfml-system
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
18
samples/opengl/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = opengl
|
||||
OBJ = OpenGL.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
opengl: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-graphics -lsfml-window -lsfml-system -lGLU -lGL
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
143
samples/opengl/OpenGL.cpp
Normal file
|
@ -0,0 +1,143 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Create main window
|
||||
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML OpenGL");
|
||||
App.PreserveOpenGLStates(true);
|
||||
|
||||
// Create a sprite for the background
|
||||
sf::Image BackgroundImage;
|
||||
if (!BackgroundImage.LoadFromFile("datas/opengl/background.jpg"))
|
||||
return EXIT_FAILURE;
|
||||
sf::Sprite Background(BackgroundImage);
|
||||
|
||||
// Load an OpenGL texture.
|
||||
// We could directly use a sf::Image as an OpenGL texture (with its Bind() member function),
|
||||
// but here we want more control on it (generate mipmaps, ...) so we create a new one
|
||||
GLuint Texture = 0;
|
||||
{
|
||||
sf::Image Image;
|
||||
if (!Image.LoadFromFile("datas/opengl/texture.jpg"))
|
||||
return EXIT_FAILURE;
|
||||
glGenTextures(1, &Texture);
|
||||
glBindTexture(GL_TEXTURE_2D, Texture);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, Image.GetWidth(), Image.GetHeight(), GL_RGBA, GL_UNSIGNED_BYTE, Image.GetPixelsPtr());
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
}
|
||||
|
||||
// Enable Z-buffer read and write
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_TRUE);
|
||||
glClearDepth(1.f);
|
||||
|
||||
// Setup a perspective projection
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(90.f, 1.f, 1.f, 500.f);
|
||||
|
||||
// Bind our texture
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBindTexture(GL_TEXTURE_2D, Texture);
|
||||
glColor4f(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
// Create a clock for measuring the time elapsed
|
||||
sf::Clock Clock;
|
||||
|
||||
// Start game loop
|
||||
while (App.IsOpened())
|
||||
{
|
||||
// Process events
|
||||
sf::Event Event;
|
||||
while (App.GetEvent(Event))
|
||||
{
|
||||
// Close window : exit
|
||||
if (Event.Type == sf::Event::Closed)
|
||||
App.Close();
|
||||
|
||||
// Escape key : exit
|
||||
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
|
||||
App.Close();
|
||||
|
||||
// Adjust the viewport when the window is resized
|
||||
if (Event.Type == sf::Event::Resized)
|
||||
glViewport(0, 0, Event.Size.Width, Event.Size.Height);
|
||||
}
|
||||
|
||||
// Draw background
|
||||
App.Draw(Background);
|
||||
|
||||
// Clear depth buffer
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Apply some transformations
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.f, 0.f, -200.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 90, 0.f, 0.f, 1.f);
|
||||
|
||||
// Draw a cube
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
glTexCoord2f(0, 0); glVertex3f(-50.f, -50.f, -50.f);
|
||||
glTexCoord2f(0, 1); glVertex3f(-50.f, 50.f, -50.f);
|
||||
glTexCoord2f(1, 1); glVertex3f( 50.f, 50.f, -50.f);
|
||||
glTexCoord2f(1, 0); glVertex3f( 50.f, -50.f, -50.f);
|
||||
|
||||
glTexCoord2f(0, 0); glVertex3f(-50.f, -50.f, 50.f);
|
||||
glTexCoord2f(0, 1); glVertex3f(-50.f, 50.f, 50.f);
|
||||
glTexCoord2f(1, 1); glVertex3f( 50.f, 50.f, 50.f);
|
||||
glTexCoord2f(1, 0); glVertex3f( 50.f, -50.f, 50.f);
|
||||
|
||||
glTexCoord2f(0, 0); glVertex3f(-50.f, -50.f, -50.f);
|
||||
glTexCoord2f(0, 1); glVertex3f(-50.f, 50.f, -50.f);
|
||||
glTexCoord2f(1, 1); glVertex3f(-50.f, 50.f, 50.f);
|
||||
glTexCoord2f(1, 0); glVertex3f(-50.f, -50.f, 50.f);
|
||||
|
||||
glTexCoord2f(0, 0); glVertex3f(50.f, -50.f, -50.f);
|
||||
glTexCoord2f(0, 1); glVertex3f(50.f, 50.f, -50.f);
|
||||
glTexCoord2f(1, 1); glVertex3f(50.f, 50.f, 50.f);
|
||||
glTexCoord2f(1, 0); glVertex3f(50.f, -50.f, 50.f);
|
||||
|
||||
glTexCoord2f(0, 1); glVertex3f(-50.f, -50.f, 50.f);
|
||||
glTexCoord2f(0, 0); glVertex3f(-50.f, -50.f, -50.f);
|
||||
glTexCoord2f(1, 0); glVertex3f( 50.f, -50.f, -50.f);
|
||||
glTexCoord2f(1, 1); glVertex3f( 50.f, -50.f, 50.f);
|
||||
|
||||
glTexCoord2f(0, 1); glVertex3f(-50.f, 50.f, 50.f);
|
||||
glTexCoord2f(0, 0); glVertex3f(-50.f, 50.f, -50.f);
|
||||
glTexCoord2f(1, 0); glVertex3f( 50.f, 50.f, -50.f);
|
||||
glTexCoord2f(1, 1); glVertex3f( 50.f, 50.f, 50.f);
|
||||
|
||||
glEnd();
|
||||
|
||||
// Draw some text on top of our OpenGL object
|
||||
sf::String Text("This is a rotating cube");
|
||||
Text.SetPosition(250.f, 300.f);
|
||||
Text.SetColor(sf::Color(128, 0, 128));
|
||||
App.Draw(Text);
|
||||
|
||||
// Finally, display the rendered frame on screen
|
||||
App.Display();
|
||||
}
|
||||
|
||||
// Don't forget to destroy our texture
|
||||
glDeleteTextures(1, &Texture);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
samples/pong/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = pong
|
||||
OBJ = Pong.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
pong: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
190
samples/pong/Pong.cpp
Normal file
|
@ -0,0 +1,190 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Defines PI
|
||||
const float PI = 3.14159f;
|
||||
|
||||
// Create the window of the application
|
||||
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Pong");
|
||||
|
||||
// Load the sounds used in the game
|
||||
sf::SoundBuffer BallSoundBuffer;
|
||||
if (!BallSoundBuffer.LoadFromFile("datas/pong/ball.wav"))
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
sf::Sound BallSound(BallSoundBuffer);
|
||||
|
||||
// Load the images used in the game
|
||||
sf::Image BackgroundImage, LeftPaddleImage, RightPaddleImage, BallImage;
|
||||
if (!BackgroundImage.LoadFromFile("datas/pong/background.jpg") ||
|
||||
!LeftPaddleImage.LoadFromFile("datas/pong/paddle_left.png") ||
|
||||
!RightPaddleImage.LoadFromFile("datas/pong/paddle_right.png") ||
|
||||
!BallImage.LoadFromFile("datas/pong/ball.png"))
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Load the text font
|
||||
sf::Font Cheeseburger;
|
||||
if (!Cheeseburger.LoadFromFile("datas/post-fx/cheeseburger.ttf"))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Initialize the end text
|
||||
sf::String End;
|
||||
End.SetFont(Cheeseburger);
|
||||
End.SetSize(60.f);
|
||||
End.Move(150.f, 200.f);
|
||||
End.SetColor(sf::Color(50, 50, 250));
|
||||
|
||||
// Create the sprites of the background, the paddles and the ball
|
||||
sf::Sprite Background(BackgroundImage);
|
||||
sf::Sprite LeftPaddle(LeftPaddleImage);
|
||||
sf::Sprite RightPaddle(RightPaddleImage);
|
||||
sf::Sprite Ball(BallImage);
|
||||
|
||||
LeftPaddle.Move(10, (App.GetView().GetRect().GetHeight() - LeftPaddle.GetSize().y) / 2);
|
||||
RightPaddle.Move(App.GetView().GetRect().GetWidth() - RightPaddle.GetSize().x - 10, (App.GetView().GetRect().GetHeight() - RightPaddle.GetSize().y) / 2);
|
||||
Ball.Move((App.GetView().GetRect().GetWidth() - Ball.GetSize().x) / 2, (App.GetView().GetRect().GetHeight() - Ball.GetSize().y) / 2);
|
||||
|
||||
// Define the paddles properties
|
||||
sf::Clock AITimer;
|
||||
const float AITime = 0.1f;
|
||||
float LeftPaddleSpeed = 400.f;
|
||||
float RightPaddleSpeed = 400.f;
|
||||
|
||||
// Define the ball properties
|
||||
float BallSpeed = 400.f;
|
||||
float BallAngle;
|
||||
do
|
||||
{
|
||||
// Make sure the ball initial angle is not too much vertical
|
||||
BallAngle = sf::Randomizer::Random(0.f, 2 * PI);
|
||||
} while (std::abs(std::cos(BallAngle)) < 0.7f);
|
||||
|
||||
bool IsPlaying = true;
|
||||
while (App.IsOpened())
|
||||
{
|
||||
// Handle events
|
||||
sf::Event Event;
|
||||
while (App.GetEvent(Event))
|
||||
{
|
||||
// Window closed or escape key pressed : exit
|
||||
if ((Event.Type == sf::Event::Closed) ||
|
||||
((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)))
|
||||
{
|
||||
App.Close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsPlaying)
|
||||
{
|
||||
// Move the player's paddle
|
||||
if (App.GetInput().IsKeyDown(sf::Key::Up) && (LeftPaddle.GetPosition().y > 5.f))
|
||||
LeftPaddle.Move(0.f, -LeftPaddleSpeed * App.GetFrameTime());
|
||||
if (App.GetInput().IsKeyDown(sf::Key::Down) && (LeftPaddle.GetPosition().y < App.GetView().GetRect().GetHeight() - LeftPaddle.GetSize().y - 5.f))
|
||||
LeftPaddle.Move(0.f, LeftPaddleSpeed * App.GetFrameTime());
|
||||
|
||||
// Move the computer's paddle
|
||||
if (((RightPaddleSpeed < 0.f) && (RightPaddle.GetPosition().y > 5.f)) ||
|
||||
((RightPaddleSpeed > 0.f) && (RightPaddle.GetPosition().y < App.GetView().GetRect().GetHeight() - RightPaddle.GetSize().y - 5.f)))
|
||||
{
|
||||
RightPaddle.Move(0.f, RightPaddleSpeed * App.GetFrameTime());
|
||||
}
|
||||
|
||||
// Update the computer's paddle direction according to the ball position
|
||||
if (AITimer.GetElapsedTime() > AITime)
|
||||
{
|
||||
AITimer.Reset();
|
||||
if ((RightPaddleSpeed < 0) && (Ball.GetPosition().y + Ball.GetSize().y > RightPaddle.GetPosition().y + RightPaddle.GetSize().y))
|
||||
RightPaddleSpeed = -RightPaddleSpeed;
|
||||
if ((RightPaddleSpeed > 0) && (Ball.GetPosition().y < RightPaddle.GetPosition().y))
|
||||
RightPaddleSpeed = -RightPaddleSpeed;
|
||||
}
|
||||
|
||||
// Move the ball
|
||||
float Factor = BallSpeed * App.GetFrameTime();
|
||||
Ball.Move(std::cos(BallAngle) * Factor, std::sin(BallAngle) * Factor);
|
||||
|
||||
// Check collisions between the ball and the screen
|
||||
if (Ball.GetPosition().x < 0.f)
|
||||
{
|
||||
IsPlaying = false;
|
||||
End.SetText("You lost !\n(press escape to exit)");
|
||||
}
|
||||
if (Ball.GetPosition().x + Ball.GetSize().x > App.GetView().GetRect().GetWidth())
|
||||
{
|
||||
IsPlaying = false;
|
||||
End.SetText("You won !\n(press escape to exit)");
|
||||
}
|
||||
if (Ball.GetPosition().y < 0.f)
|
||||
{
|
||||
BallSound.Play();
|
||||
BallAngle = -BallAngle;
|
||||
Ball.SetY(0.1f);
|
||||
}
|
||||
if (Ball.GetPosition().y + Ball.GetSize().y > App.GetView().GetRect().GetHeight())
|
||||
{
|
||||
BallSound.Play();
|
||||
BallAngle = -BallAngle;
|
||||
Ball.SetY(App.GetView().GetRect().GetHeight() - Ball.GetSize().y - 0.1f);
|
||||
}
|
||||
|
||||
// Check the collisions between the ball and the paddles
|
||||
// Left Paddle
|
||||
if (Ball.GetPosition().x < LeftPaddle.GetPosition().x + LeftPaddle.GetSize().x &&
|
||||
Ball.GetPosition().x > LeftPaddle.GetPosition().x + (LeftPaddle.GetSize().x / 2.0f) &&
|
||||
Ball.GetPosition().y + Ball.GetSize().y >= LeftPaddle.GetPosition().y &&
|
||||
Ball.GetPosition().y <= LeftPaddle.GetPosition().y + LeftPaddle.GetSize().y)
|
||||
{
|
||||
BallSound.Play();
|
||||
BallAngle = PI - BallAngle;
|
||||
Ball.SetX(LeftPaddle.GetPosition().x + LeftPaddle.GetSize().x + 0.1f);
|
||||
}
|
||||
|
||||
// Right Paddle
|
||||
if (Ball.GetPosition().x + Ball.GetSize().x > RightPaddle.GetPosition().x &&
|
||||
Ball.GetPosition().x + Ball.GetSize().x < RightPaddle.GetPosition().x + (RightPaddle.GetSize().x / 2.0f) &&
|
||||
Ball.GetPosition().y + Ball.GetSize().y >= RightPaddle.GetPosition().y &&
|
||||
Ball.GetPosition().y <= RightPaddle.GetPosition().y + RightPaddle.GetSize().y)
|
||||
{
|
||||
BallSound.Play();
|
||||
BallAngle = PI - BallAngle;
|
||||
Ball.SetX(RightPaddle.GetPosition().x - Ball.GetSize().x - 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the window
|
||||
App.Clear();
|
||||
|
||||
// Draw the background, paddles and ball sprites
|
||||
App.Draw(Background);
|
||||
App.Draw(LeftPaddle);
|
||||
App.Draw(RightPaddle);
|
||||
App.Draw(Ball);
|
||||
|
||||
// If the game is over, display the end message
|
||||
if (!IsPlaying)
|
||||
App.Draw(End);
|
||||
|
||||
// Display things on screen
|
||||
App.Display();
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
samples/post-fx/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = post-fx
|
||||
OBJ = PostFX.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
post-fx: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-graphics -lsfml-window -lsfml-system
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
184
samples/post-fx/PostFX.cpp
Normal file
|
@ -0,0 +1,184 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <map>
|
||||
|
||||
void DisplayError();
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Check that the system can use post effects
|
||||
if (sf::PostFX::CanUsePostFX() == false)
|
||||
{
|
||||
DisplayError();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
// Create the main window
|
||||
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML PostFX");
|
||||
|
||||
// Load a cute background image to display :)
|
||||
sf::Image BackgroundImage;
|
||||
if (!BackgroundImage.LoadFromFile("datas/post-fx/background.jpg"))
|
||||
return EXIT_FAILURE;
|
||||
sf::Sprite Background(BackgroundImage);
|
||||
|
||||
// Load the text font
|
||||
sf::Font Cheeseburger;
|
||||
if (!Cheeseburger.LoadFromFile("datas/post-fx/cheeseburger.ttf"))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Load the image needed for the wave effect
|
||||
sf::Image WaveImage;
|
||||
if (!WaveImage.LoadFromFile("datas/post-fx/wave.jpg"))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Load all effects
|
||||
std::map<std::string, sf::PostFX> Effects;
|
||||
if (!Effects["nothing"].LoadFromFile("datas/post-fx/nothing.sfx")) return EXIT_FAILURE;
|
||||
if (!Effects["blur"].LoadFromFile("datas/post-fx/blur.sfx")) return EXIT_FAILURE;
|
||||
if (!Effects["colorize"].LoadFromFile("datas/post-fx/colorize.sfx")) return EXIT_FAILURE;
|
||||
if (!Effects["fisheye"].LoadFromFile("datas/post-fx/fisheye.sfx")) return EXIT_FAILURE;
|
||||
if (!Effects["wave"].LoadFromFile("datas/post-fx/wave.sfx")) return EXIT_FAILURE;
|
||||
std::map<std::string, sf::PostFX>::iterator CurrentEffect = Effects.find("nothing");
|
||||
|
||||
// Do specific initializations
|
||||
Effects["nothing"].SetTexture("framebuffer", NULL);
|
||||
Effects["blur"].SetTexture("framebuffer", NULL);
|
||||
Effects["blur"].SetParameter("offset", 0.f);
|
||||
Effects["colorize"].SetTexture("framebuffer", NULL);
|
||||
Effects["colorize"].SetParameter("color", 1.f, 1.f, 1.f);
|
||||
Effects["fisheye"].SetTexture("framebuffer", NULL);
|
||||
Effects["wave"].SetTexture("framebuffer", NULL);
|
||||
Effects["wave"].SetTexture("wave", &WaveImage);
|
||||
|
||||
// Define a string for displaying current effect description
|
||||
sf::String CurFXStr;
|
||||
CurFXStr.SetText("Current effect is \"" + CurrentEffect->first + "\"");
|
||||
CurFXStr.SetFont(Cheeseburger);
|
||||
CurFXStr.SetPosition(20.f, 0.f);
|
||||
|
||||
// Define a string for displaying help
|
||||
sf::String InfoStr;
|
||||
InfoStr.SetText("Move your mouse to change the effect parameters\nPress numpad + and - to change effect\nWarning : some effects may not work\ndepending on your graphics card");
|
||||
InfoStr.SetFont(Cheeseburger);
|
||||
InfoStr.SetPosition(20.f, 460.f);
|
||||
InfoStr.SetColor(sf::Color(200, 100, 150));
|
||||
|
||||
// Start the game loop
|
||||
while (App.IsOpened())
|
||||
{
|
||||
// Process events
|
||||
sf::Event Event;
|
||||
while (App.GetEvent(Event))
|
||||
{
|
||||
// Close window : exit
|
||||
if (Event.Type == sf::Event::Closed)
|
||||
App.Close();
|
||||
|
||||
if (Event.Type == sf::Event::KeyPressed)
|
||||
{
|
||||
// Escape key : exit
|
||||
if (Event.Key.Code == sf::Key::Escape)
|
||||
App.Close();
|
||||
|
||||
// Add key : next effect
|
||||
if (Event.Key.Code == sf::Key::Add)
|
||||
{
|
||||
CurrentEffect++;
|
||||
if (CurrentEffect == Effects.end())
|
||||
CurrentEffect = Effects.begin();
|
||||
CurFXStr.SetText("Current effect is \"" + CurrentEffect->first + "\"");
|
||||
}
|
||||
|
||||
// Subtract key : previous effect
|
||||
if (Event.Key.Code == sf::Key::Subtract)
|
||||
{
|
||||
if (CurrentEffect == Effects.begin())
|
||||
CurrentEffect = Effects.end();
|
||||
CurrentEffect--;
|
||||
CurFXStr.SetText("Current effect is \"" + CurrentEffect->first + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get the mouse position in the range [0, 1]
|
||||
float X = App.GetInput().GetMouseX() / static_cast<float>(App.GetWidth());
|
||||
float Y = App.GetInput().GetMouseY() / static_cast<float>(App.GetHeight());
|
||||
|
||||
// Update the current effect
|
||||
if (CurrentEffect->first == "blur") CurrentEffect->second.SetParameter("offset", X * Y * 0.1f);
|
||||
else if (CurrentEffect->first == "colorize") CurrentEffect->second.SetParameter("color", 0.3f, X, Y);
|
||||
else if (CurrentEffect->first == "fisheye") CurrentEffect->second.SetParameter("mouse", X, 1.f - Y);
|
||||
else if (CurrentEffect->first == "wave") CurrentEffect->second.SetParameter("offset", X, Y);
|
||||
|
||||
// Clear the window
|
||||
App.Clear();
|
||||
|
||||
// Draw background and apply the post-fx
|
||||
App.Draw(Background);
|
||||
App.Draw(CurrentEffect->second);
|
||||
|
||||
// Draw interface strings
|
||||
App.Draw(CurFXStr);
|
||||
App.Draw(InfoStr);
|
||||
|
||||
// Finally, display the rendered frame on screen
|
||||
App.Display();
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Fonction called when the post-effects are not supported ;
|
||||
/// Display an error message and wait until the user exits
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DisplayError()
|
||||
{
|
||||
// Create the main window
|
||||
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML PostFX");
|
||||
|
||||
// Define a string for displaying the error message
|
||||
sf::String ErrorStr("Sorry, your system doesn't support post-effects");
|
||||
ErrorStr.SetPosition(100.f, 250.f);
|
||||
ErrorStr.SetColor(sf::Color(200, 100, 150));
|
||||
|
||||
// Start the game loop
|
||||
bool Running = true;
|
||||
while (Running)
|
||||
{
|
||||
// Process events
|
||||
sf::Event Event;
|
||||
while (App.GetEvent(Event))
|
||||
{
|
||||
// Close window : exit
|
||||
if (Event.Type == sf::Event::Closed)
|
||||
Running = false;
|
||||
|
||||
// Escape key : exit
|
||||
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
|
||||
Running = false;
|
||||
}
|
||||
|
||||
// Clear the window
|
||||
App.Clear();
|
||||
|
||||
// Draw the error message
|
||||
App.Draw(ErrorStr);
|
||||
|
||||
// Finally, display the rendered frame on screen
|
||||
App.Display();
|
||||
}
|
||||
}
|
107
samples/qt/Main.cpp
Normal file
|
@ -0,0 +1,107 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include "QSFMLCanvas.hpp"
|
||||
#include <Qt/qapplication.h>
|
||||
#include <Qt/qframe.h>
|
||||
#include <Qt/qlabel.h>
|
||||
#include <Qt/qevent.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Custom SFML canvas
|
||||
////////////////////////////////////////////////////////////
|
||||
class MyCanvas : public QSFMLCanvas
|
||||
{
|
||||
public :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct the canvas
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
MyCanvas(QWidget* Parent, const QPoint& Position, const QSize& Size) :
|
||||
QSFMLCanvas(Parent, Position, Size)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// /see QSFMLCanvas::OnInit
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnInit()
|
||||
{
|
||||
// Load the image
|
||||
myImage.LoadFromFile("datas/qt/sfml.png");
|
||||
|
||||
// Setup the sprite
|
||||
mySprite.SetImage(myImage);
|
||||
mySprite.SetCenter(mySprite.GetSize() / 2.f);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// /see QSFMLCanvas::OnUpdate
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnUpdate()
|
||||
{
|
||||
sf::Event Event;
|
||||
while (GetEvent(Event))
|
||||
{
|
||||
// Stick the sprite to the mouse cursor
|
||||
if (Event.Type == sf::Event::MouseMoved)
|
||||
{
|
||||
mySprite.SetX(Event.MouseMove.X);
|
||||
mySprite.SetY(Event.MouseMove.Y);
|
||||
}
|
||||
}
|
||||
|
||||
// Rotate the sprite
|
||||
mySprite.Rotate(GetFrameTime() * 100.f);
|
||||
|
||||
// Clear the view
|
||||
Clear(sf::Color(0, 128, 0));
|
||||
|
||||
// Draw it
|
||||
Draw(mySprite);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Image myImage; ///< Some image to show
|
||||
sf::Sprite mySprite; ///< A sprite to display the image
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication App(argc, argv);
|
||||
|
||||
// Create the main frame
|
||||
QFrame* MainFrame = new QFrame;
|
||||
MainFrame->setWindowTitle("Qt SFML");
|
||||
MainFrame->resize(400, 400);
|
||||
MainFrame->show();
|
||||
|
||||
// Create a label for showing some text
|
||||
QLabel* Label = new QLabel("This is a SFML window\nembedded into a Qt frame :", MainFrame);
|
||||
Label->move(20, 10);
|
||||
Label->setFont(QFont("courier new", 14, 1, false));
|
||||
Label->show();
|
||||
|
||||
// Create a SFML view inside the main frame
|
||||
MyCanvas* SFMLView = new MyCanvas(MainFrame, QPoint(20, 60), QSize(360, 320));
|
||||
SFMLView->show();
|
||||
|
||||
return App.exec();
|
||||
}
|
18
samples/qt/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = qt
|
||||
OBJ = Main.o QSFMLCanvas.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
qt: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-graphics -lsfml-window -lsfml-system -lQtCore -lQtGui -lX11
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS) -I/usr/include/qt4
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
106
samples/qt/QSFMLCanvas.cpp
Normal file
|
@ -0,0 +1,106 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include "QSFMLCanvas.hpp"
|
||||
|
||||
// Platform-specific headers
|
||||
#ifdef Q_WS_X11
|
||||
#include <Qt/qx11info_x11.h>
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct the QSFMLCanvas
|
||||
////////////////////////////////////////////////////////////
|
||||
QSFMLCanvas::QSFMLCanvas(QWidget* Parent, const QPoint& Position, const QSize& Size, unsigned int FrameTime) :
|
||||
QWidget (Parent),
|
||||
myInitialized (false)
|
||||
{
|
||||
// Setup some states to allow direct rendering into the widget
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
|
||||
// Set strong focus to enable keyboard events to be received
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
// Setup the widget geometry
|
||||
move(Position);
|
||||
resize(Size);
|
||||
|
||||
// Setup the timer
|
||||
myTimer.setInterval(FrameTime);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Destructor
|
||||
////////////////////////////////////////////////////////////
|
||||
QSFMLCanvas::~QSFMLCanvas()
|
||||
{
|
||||
// Nothing to do...
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Notification for the derived class that moment is good
|
||||
/// for doing initializations
|
||||
////////////////////////////////////////////////////////////
|
||||
void QSFMLCanvas::OnInit()
|
||||
{
|
||||
// Nothing to do by default...
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Notification for the derived class that moment is good
|
||||
/// for doing its update and drawing stuff
|
||||
////////////////////////////////////////////////////////////
|
||||
void QSFMLCanvas::OnUpdate()
|
||||
{
|
||||
// Nothing to do by default...
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the widget is shown ;
|
||||
/// we use it to initialize our SFML window
|
||||
////////////////////////////////////////////////////////////
|
||||
void QSFMLCanvas::showEvent(QShowEvent*)
|
||||
{
|
||||
if (!myInitialized)
|
||||
{
|
||||
// Under X11, we need to flush the commands sent to the server to ensure that
|
||||
// SFML will get an updated view of the windows
|
||||
#ifdef Q_WS_X11
|
||||
XFlush(QX11Info::display());
|
||||
#endif
|
||||
|
||||
// Create the SFML window with the widget handle
|
||||
Create(winId());
|
||||
|
||||
// Let the derived class do its specific stuff
|
||||
OnInit();
|
||||
|
||||
// Setup the timer to trigger a refresh at specified framerate
|
||||
connect(&myTimer, SIGNAL(timeout()), this, SLOT(repaint()));
|
||||
myTimer.start();
|
||||
|
||||
myInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the widget needs to be painted ;
|
||||
/// we use it to display a new frame
|
||||
////////////////////////////////////////////////////////////
|
||||
void QSFMLCanvas::paintEvent(QPaintEvent*)
|
||||
{
|
||||
// Let the derived class do its specific stuff
|
||||
OnUpdate();
|
||||
|
||||
// Display on screen
|
||||
Display();
|
||||
}
|
75
samples/qt/QSFMLCanvas.hpp
Normal file
|
@ -0,0 +1,75 @@
|
|||
|
||||
#ifndef QSFMLCANVAS_HPP
|
||||
#define QSFMLCANVAS_HPP
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <Qt/qwidget.h>
|
||||
#include <Qt/qtimer.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// QSFMLCanvas allows to run SFML in a Qt control
|
||||
////////////////////////////////////////////////////////////
|
||||
class QSFMLCanvas : public QWidget, public sf::RenderWindow
|
||||
{
|
||||
public :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct the QSFMLCanvas
|
||||
///
|
||||
/// \param Parent : Parent of the widget
|
||||
/// \param Position : Position of the widget
|
||||
/// \param Size : Size of the widget
|
||||
/// \param FrameTime : Frame duration, in milliseconds (0 by default)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
QSFMLCanvas(QWidget* Parent, const QPoint& Position, const QSize& Size, unsigned int FrameTime = 0);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Destructor
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual ~QSFMLCanvas();
|
||||
|
||||
private :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Notification for the derived class that moment is good
|
||||
/// for doing initializations
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnInit();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Notification for the derived class that moment is good
|
||||
/// for doing its update and drawing stuff
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnUpdate();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the widget is shown ;
|
||||
/// we use it to initialize our SFML window
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void showEvent(QShowEvent*);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the widget needs to be painted ;
|
||||
/// we use it to display a new frame
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void paintEvent(QPaintEvent*);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
QTimer myTimer; ///< Timer used to update the view
|
||||
bool myInitialized; ///< Tell whether the SFML window has been initialized or not
|
||||
};
|
||||
|
||||
|
||||
#endif // QSFMLCANVAS_HPP
|
18
samples/sockets/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = sockets
|
||||
OBJ = Sockets.o TCP.o UDP.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
sockets: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-network -lsfml-system
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
62
samples/sockets/Sockets.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Function prototypes
|
||||
// (I'm too lazy to put them into separate headers...)
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoClientTCP(unsigned short Port);
|
||||
void DoClientUDP(unsigned short Port);
|
||||
void DoServerTCP(unsigned short Port);
|
||||
void DoServerUDP(unsigned short Port);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Choose a random port for opening sockets (ports < 1024 are reserved)
|
||||
const unsigned short Port = 2435;
|
||||
|
||||
// TCP or UDP ?
|
||||
char Protocol;
|
||||
std::cout << "Do you want to use TCP ('t') or UDP ('u') ? ";
|
||||
std::cin >> Protocol;
|
||||
|
||||
// Client or server ?
|
||||
char Who;
|
||||
std::cout << "Do you want to be a server ('s') or a client ('c') ? ";
|
||||
std::cin >> Who;
|
||||
|
||||
if (Who == 's')
|
||||
{
|
||||
// Run as a server
|
||||
if (Protocol == 't')
|
||||
DoServerTCP(Port);
|
||||
else
|
||||
DoServerUDP(Port);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Run as a client
|
||||
if (Protocol == 't')
|
||||
DoClientTCP(Port);
|
||||
else
|
||||
DoClientUDP(Port);
|
||||
}
|
||||
|
||||
// Wait until the user presses 'enter' key
|
||||
std::cout << "Press enter to exit..." << std::endl;
|
||||
std::cin.ignore(10000, '\n');
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
93
samples/sockets/TCP.cpp
Normal file
|
@ -0,0 +1,93 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Network.hpp>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Create a client and connect it to a running server
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoClientTCP(unsigned short Port)
|
||||
{
|
||||
// Ask for server address
|
||||
sf::IPAddress ServerAddress;
|
||||
do
|
||||
{
|
||||
std::cout << "Type address or name of the server to connect to : ";
|
||||
std::cin >> ServerAddress;
|
||||
}
|
||||
while (!ServerAddress.IsValid());
|
||||
|
||||
// Create a TCP socket for communicating with server
|
||||
sf::SocketTCP Client;
|
||||
|
||||
// Connect to the specified server
|
||||
if (Client.Connect(Port, ServerAddress) != sf::Socket::Done)
|
||||
return;
|
||||
std::cout << "Connected to server " << ServerAddress << std::endl;
|
||||
|
||||
// Receive a message from the client
|
||||
char Message[128];
|
||||
std::size_t Received;
|
||||
if (Client.Receive(Message, sizeof(Message), Received) != sf::Socket::Done)
|
||||
return;
|
||||
|
||||
// Show it
|
||||
std::cout << "Message received from server : \"" << Message << "\"" << std::endl;
|
||||
|
||||
// Define a message to send back to the server
|
||||
char ToSend[] = "Hi, I'm a client !";
|
||||
|
||||
// Send the message
|
||||
if (Client.Send(ToSend, sizeof(ToSend)) != sf::Socket::Done)
|
||||
return;
|
||||
std::cout << "Message sent to server : \"" << ToSend << "\"" << std::endl;
|
||||
|
||||
// Close the socket when we're done
|
||||
Client.Close();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Launch a server and wait for incoming connections
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoServerTCP(unsigned short Port)
|
||||
{
|
||||
// Create a TCP socket for communicating with clients
|
||||
sf::SocketTCP Server;
|
||||
|
||||
// Listen to a port for incoming connections
|
||||
if (!Server.Listen(Port))
|
||||
return;
|
||||
std::cout << "Server is listening to port " << Port << ", waiting for connections... " << std::endl;
|
||||
|
||||
// Wait for a connection
|
||||
sf::IPAddress ClientAddress;
|
||||
sf::SocketTCP Client;
|
||||
if (Server.Accept(Client, &ClientAddress) != sf::Socket::Done)
|
||||
return;
|
||||
std::cout << "Client connected : " << ClientAddress << std::endl;
|
||||
|
||||
// Send a message to the client
|
||||
char ToSend[] = "Hi, I'm the server";
|
||||
if (Client.Send(ToSend, sizeof(ToSend)) != sf::Socket::Done)
|
||||
return;
|
||||
std::cout << "Message sent to the client : \"" << ToSend << "\"" << std::endl;
|
||||
|
||||
// Receive a message back from the client
|
||||
char Message[128];
|
||||
std::size_t Received;
|
||||
if (Client.Receive(Message, sizeof(Message), Received) != sf::Socket::Done)
|
||||
return;
|
||||
|
||||
// Show the message
|
||||
std::cout << "Message received from the client : \"" << Message << "\"" << std::endl;
|
||||
|
||||
// Close the sockets when we're done
|
||||
Client.Close();
|
||||
Server.Close();
|
||||
}
|
65
samples/sockets/UDP.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Network.hpp>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Create a client and send a message to a running server
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoClientUDP(unsigned short Port)
|
||||
{
|
||||
// Ask for server address
|
||||
sf::IPAddress ServerAddress;
|
||||
do
|
||||
{
|
||||
std::cout << "Type address or name of the server to send the message to : ";
|
||||
std::cin >> ServerAddress;
|
||||
}
|
||||
while (!ServerAddress.IsValid());
|
||||
|
||||
// Create a UDP socket for communicating with server
|
||||
sf::SocketUDP Client;
|
||||
|
||||
// Send a message to the server
|
||||
char Message[] = "Hi, I'm a client !";
|
||||
if (Client.Send(Message, sizeof(Message), ServerAddress, Port) != sf::Socket::Done)
|
||||
return;
|
||||
std::cout << "Message sent to server : \"" << Message << "\"" << std::endl;
|
||||
|
||||
// Close the socket when we're done
|
||||
Client.Close();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Launch a server and wait for incoming messages
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoServerUDP(unsigned short Port)
|
||||
{
|
||||
// Create a UDP socket for communicating with clients
|
||||
sf::SocketUDP Server;
|
||||
|
||||
// Bind it to the specified port
|
||||
if (!Server.Bind(Port))
|
||||
return;
|
||||
|
||||
// Receive a message from anyone
|
||||
sf::IPAddress ClientAddress;
|
||||
unsigned short ClientPort;
|
||||
char Message[128];
|
||||
std::size_t Received;
|
||||
if (Server.Receive(Message, sizeof(Message), Received, ClientAddress, ClientPort) != sf::Socket::Done)
|
||||
return;
|
||||
|
||||
// Display it
|
||||
std::cout << "Message received from " << ClientAddress << " on port " << ClientPort
|
||||
<< ": \"" << Message << "\"" << std::endl;
|
||||
|
||||
// Close the socket when we're done
|
||||
Server.Close();
|
||||
}
|
18
samples/sound/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = sound
|
||||
OBJ = Sound.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
sound: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-audio -lsfml-system
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
96
samples/sound/Sound.cpp
Normal file
|
@ -0,0 +1,96 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Play a sound
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void PlaySound()
|
||||
{
|
||||
// Load a sound buffer from a wav file
|
||||
sf::SoundBuffer Buffer;
|
||||
if (!Buffer.LoadFromFile("datas/sound/footsteps.wav"))
|
||||
return;
|
||||
|
||||
// Display sound informations
|
||||
std::cout << "footsteps.wav :" << std::endl;
|
||||
std::cout << " " << Buffer.GetDuration() << " sec" << std::endl;
|
||||
std::cout << " " << Buffer.GetSampleRate() << " samples / sec" << std::endl;
|
||||
std::cout << " " << Buffer.GetChannelsCount() << " channels" << std::endl;
|
||||
|
||||
// Create a sound instance and play it
|
||||
sf::Sound Sound(Buffer);
|
||||
Sound.Play();
|
||||
|
||||
// Loop while the sound is playing
|
||||
while (Sound.GetStatus() == sf::Sound::Playing)
|
||||
{
|
||||
// Display the playing position
|
||||
std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << Sound.GetPlayingOffset() << " sec ";
|
||||
|
||||
// Leave some CPU time for other processes
|
||||
sf::Sleep(0.1f);
|
||||
}
|
||||
std::cout << std::endl << std::endl;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Play a music
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void PlayMusic()
|
||||
{
|
||||
// Load an ogg music file
|
||||
sf::Music Music;
|
||||
if (!Music.OpenFromFile("datas/sound/lepidoptera.ogg"))
|
||||
return;
|
||||
|
||||
// Display music informations
|
||||
std::cout << "lepidoptera.ogg :" << std::endl;
|
||||
std::cout << " " << Music.GetDuration() << " sec" << std::endl;
|
||||
std::cout << " " << Music.GetSampleRate() << " samples / sec" << std::endl;
|
||||
std::cout << " " << Music.GetChannelsCount() << " channels" << std::endl;
|
||||
|
||||
// Play it
|
||||
Music.Play();
|
||||
|
||||
// Loop while the music is playing
|
||||
while (Music.GetStatus() == sf::Music::Playing)
|
||||
{
|
||||
// Display the playing position
|
||||
std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << Music.GetPlayingOffset() << " sec ";
|
||||
|
||||
// Leave some CPU time for other processes
|
||||
sf::Sleep(0.1f);
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Play a sound
|
||||
PlaySound();
|
||||
|
||||
// Play a music
|
||||
PlayMusic();
|
||||
|
||||
// Wait until the user presses 'enter' key
|
||||
std::cout << "Press enter to exit..." << std::endl;
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
samples/sound_capture/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = sound_capture
|
||||
OBJ = SoundCapture.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
sound_capture: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-audio -lsfml-system
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
94
samples/sound_capture/SoundCapture.cpp
Normal file
|
@ -0,0 +1,94 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Check that the device can capture audio
|
||||
if (sf::SoundRecorder::CanCapture() == false)
|
||||
{
|
||||
std::cout << "Sorry, audio capture is not supported by your system" << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
// Choose the sample rate
|
||||
unsigned int SampleRate;
|
||||
std::cout << "Please choose the sample rate for sound capture (44100 is CD quality) : ";
|
||||
std::cin >> SampleRate;
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
// Wait for user input...
|
||||
std::cout << "Press enter to start recording audio";
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
// Here we'll use an integrated custom recorder, which saves the captured data into a SoundBuffer
|
||||
sf::SoundBufferRecorder Recorder;
|
||||
|
||||
// Audio capture is done in a separate thread, so we can block the main thread while it is capturing
|
||||
Recorder.Start(SampleRate);
|
||||
std::cout << "Recording... press enter to stop";
|
||||
std::cin.ignore(10000, '\n');
|
||||
Recorder.Stop();
|
||||
|
||||
// Get the buffer containing the captured data
|
||||
const sf::SoundBuffer& Buffer = Recorder.GetBuffer();
|
||||
|
||||
// Display captured sound informations
|
||||
std::cout << "Sound information :" << std::endl;
|
||||
std::cout << " " << Buffer.GetDuration() << " seconds" << std::endl;
|
||||
std::cout << " " << Buffer.GetSampleRate() << " samples / seconds" << std::endl;
|
||||
std::cout << " " << Buffer.GetChannelsCount() << " channels" << std::endl;
|
||||
|
||||
// Choose what to do with the recorded sound data
|
||||
char Choice;
|
||||
std::cout << "What do you want to do with captured sound (p = play, s = save) ? ";
|
||||
std::cin >> Choice;
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
if (Choice == 's')
|
||||
{
|
||||
// Choose the filename
|
||||
std::string Filename;
|
||||
std::cout << "Choose the file to create : ";
|
||||
std::getline(std::cin, Filename);
|
||||
|
||||
// Save the buffer
|
||||
Buffer.SaveToFile(Filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create a sound instance and play it
|
||||
sf::Sound Sound(Buffer);
|
||||
Sound.Play();
|
||||
|
||||
// Wait until finished
|
||||
while (Sound.GetStatus() == sf::Sound::Playing)
|
||||
{
|
||||
// Display the playing position
|
||||
std::cout << "\rPlaying... " << std::fixed << std::setprecision(2) << Sound.GetPlayingOffset() << " sec";
|
||||
|
||||
// Leave some CPU time for other threads
|
||||
sf::Sleep(0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
// Finished !
|
||||
std::cout << std::endl << "Done !" << std::endl;
|
||||
|
||||
// Wait until the user presses 'enter' key
|
||||
std::cout << "Press enter to exit..." << std::endl;
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
110
samples/voip/Client.cpp
Normal file
|
@ -0,0 +1,110 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <SFML/Network.hpp>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
const sf::Uint8 AudioData = 1;
|
||||
const sf::Uint8 EndOfStream = 2;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Specialization of audio recorder for sending recorded audio
|
||||
/// data through the network
|
||||
////////////////////////////////////////////////////////////
|
||||
class NetworkRecorder : public sf::SoundRecorder
|
||||
{
|
||||
public :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Constructor
|
||||
///
|
||||
/// \param Socket : Socket that holds the connection with the server
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
NetworkRecorder(sf::SocketTCP Socket) :
|
||||
mySocket(Socket)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// /see SoundRecorder::ProcessSamples
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual bool OnProcessSamples(const sf::Int16* Samples, std::size_t SamplesCount)
|
||||
{
|
||||
// Pack the audio samples into a network packet
|
||||
sf::Packet PacketOut;
|
||||
PacketOut << AudioData;
|
||||
PacketOut.Append(Samples, SamplesCount * sizeof(sf::Int16));
|
||||
|
||||
// Send the audio packet to the server
|
||||
return mySocket.Send(PacketOut) == sf::Socket::Done;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::SocketTCP mySocket; ///< Socket used to communicate with the server
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Create a client, connect it to a running server and
|
||||
/// start sending him audio data
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoClient(unsigned short Port)
|
||||
{
|
||||
// Check that the device can capture audio
|
||||
if (sf::SoundRecorder::CanCapture() == false)
|
||||
{
|
||||
std::cout << "Sorry, audio capture is not supported by your system" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// Ask for server address
|
||||
sf::IPAddress ServerAddress;
|
||||
do
|
||||
{
|
||||
std::cout << "Type address or name of the server to connect to : ";
|
||||
std::cin >> ServerAddress;
|
||||
}
|
||||
while (!ServerAddress.IsValid());
|
||||
|
||||
// Create a TCP socket for communicating with server
|
||||
sf::SocketTCP Socket;
|
||||
|
||||
// Connect to the specified server
|
||||
if (Socket.Connect(Port, ServerAddress) != sf::Socket::Done)
|
||||
return;
|
||||
std::cout << "Connected to server " << ServerAddress << std::endl;
|
||||
|
||||
// Wait for user input...
|
||||
std::cin.ignore(10000, '\n');
|
||||
std::cout << "Press enter to start recording audio";
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
// Create a instance of our custom recorder
|
||||
NetworkRecorder Recorder(Socket);
|
||||
|
||||
// Start capturing audio data
|
||||
Recorder.Start(44100);
|
||||
std::cout << "Recording... press enter to stop";
|
||||
std::cin.ignore(10000, '\n');
|
||||
Recorder.Stop();
|
||||
|
||||
// Send a "end-of-stream" packet
|
||||
sf::Packet PacketOut;
|
||||
PacketOut << EndOfStream;
|
||||
Socket.Send(PacketOut);
|
||||
|
||||
// Close the socket when we're done
|
||||
Socket.Close();
|
||||
}
|
18
samples/voip/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = voip
|
||||
OBJ = VoIP.o Client.o Server.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
voip: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-audio -lsfml-network -lsfml-system
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
213
samples/voip/Server.cpp
Normal file
|
@ -0,0 +1,213 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <SFML/Network.hpp>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
const sf::Uint8 AudioData = 1;
|
||||
const sf::Uint8 EndOfStream = 2;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Customized sound stream for acquiring audio data
|
||||
/// from the network
|
||||
////////////////////////////////////////////////////////////
|
||||
class NetworkAudioStream : public sf::SoundStream
|
||||
{
|
||||
public :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Default constructor
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
NetworkAudioStream() :
|
||||
myOffset (0),
|
||||
myHasFinished(false)
|
||||
{
|
||||
// Set the sound parameters
|
||||
Initialize(1, 44100);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Destructor
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
~NetworkAudioStream()
|
||||
{
|
||||
// Close the sockets
|
||||
myClient.Close();
|
||||
myListener.Close();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Run the server, stream audio data from the client
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void Start(unsigned short Port)
|
||||
{
|
||||
if (!myHasFinished)
|
||||
{
|
||||
// Listen to the given port for incoming connections
|
||||
if (!myListener.Listen(Port))
|
||||
return;
|
||||
std::cout << "Server is listening to port " << Port << ", waiting for connections... " << std::endl;
|
||||
|
||||
// Wait for a connection
|
||||
sf::IPAddress ClientAddress;
|
||||
myListener.Accept(myClient, &ClientAddress);
|
||||
std::cout << "Client connected : " << ClientAddress << std::endl;
|
||||
|
||||
// Start playback
|
||||
Play();
|
||||
|
||||
// Start receiving audio data
|
||||
ReceiveLoop();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Start playback
|
||||
Play();
|
||||
}
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// /see SoundStream::OnStart
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual bool OnStart()
|
||||
{
|
||||
// Reset the playing offset
|
||||
myOffset = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// /see SoundStream::OnGetData
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual bool OnGetData(sf::SoundStream::Chunk& Data)
|
||||
{
|
||||
// We have reached the end of the buffer and all audio data have been played : we can stop playback
|
||||
if ((myOffset == mySamples.size()) && myHasFinished)
|
||||
return false;
|
||||
|
||||
// No new data has arrived since last update : wait until we get some
|
||||
while ((myOffset == mySamples.size()) && !myHasFinished)
|
||||
sf::Sleep(0.01f);
|
||||
|
||||
// Copy samples into a local buffer to avoid synchronization problems
|
||||
// (don't forget that we run in two separate threads)
|
||||
{
|
||||
sf::Lock Lock(myMutex);
|
||||
myTempBuffer.assign(mySamples.begin() + myOffset, mySamples.end());
|
||||
}
|
||||
|
||||
// Fill audio data to pass to the stream
|
||||
Data.Samples = &myTempBuffer[0];
|
||||
Data.NbSamples = myTempBuffer.size();
|
||||
|
||||
// Update the playing offset
|
||||
myOffset += myTempBuffer.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Get audio data from the client until playback is stopped
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void ReceiveLoop()
|
||||
{
|
||||
while (!myHasFinished)
|
||||
{
|
||||
// Get waiting audio data from the network
|
||||
sf::Packet PacketIn;
|
||||
if (myClient.Receive(PacketIn) != sf::Socket::Done)
|
||||
break;
|
||||
|
||||
// Extract the message ID
|
||||
sf::Uint8 Id;
|
||||
PacketIn >> Id;
|
||||
|
||||
if (Id == AudioData)
|
||||
{
|
||||
// Extract audio samples from the packet, and append it to our samples buffer
|
||||
const sf::Int16* Samples = reinterpret_cast<const sf::Int16*>(PacketIn.GetData() + 1);
|
||||
std::size_t NbSamples = (PacketIn.GetDataSize() - 1) / sizeof(sf::Int16);
|
||||
|
||||
// Don't forget that the other thread can access the samples array at any time
|
||||
// (so we protect any operation on it with the mutex)
|
||||
{
|
||||
sf::Lock Lock(myMutex);
|
||||
std::copy(Samples, Samples + NbSamples, std::back_inserter(mySamples));
|
||||
}
|
||||
}
|
||||
else if (Id == EndOfStream)
|
||||
{
|
||||
// End of stream reached : we stop receiving audio data
|
||||
std::cout << "Audio data has been 100% received !" << std::endl;
|
||||
myHasFinished = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Something's wrong...
|
||||
std::cout << "Invalid packet received..." << std::endl;
|
||||
myHasFinished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::SocketTCP myListener;
|
||||
sf::SocketTCP myClient;
|
||||
sf::Mutex myMutex;
|
||||
std::vector<sf::Int16> mySamples;
|
||||
std::vector<sf::Int16> myTempBuffer;
|
||||
std::size_t myOffset;
|
||||
bool myHasFinished;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Launch a server and wait for incoming audio data from
|
||||
/// a connected client
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoServer(unsigned short Port)
|
||||
{
|
||||
// Build an audio stream to play sound data as it is received through the network
|
||||
NetworkAudioStream AudioStream;
|
||||
AudioStream.Start(Port);
|
||||
|
||||
// Loop until the sound playback is finished
|
||||
while (AudioStream.GetStatus() != sf::SoundStream::Stopped)
|
||||
{
|
||||
// Leave some CPU time for other threads
|
||||
sf::Sleep(0.1f);
|
||||
}
|
||||
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
// Wait until the user presses 'enter' key
|
||||
std::cout << "Press enter to replay the sound..." << std::endl;
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
// Replay the sound (just to make sure replaying the received data is OK)
|
||||
AudioStream.Play();
|
||||
|
||||
// Loop until the sound playback is finished
|
||||
while (AudioStream.GetStatus() != sf::SoundStream::Stopped)
|
||||
{
|
||||
// Leave some CPU time for other threads
|
||||
sf::Sleep(0.1f);
|
||||
}
|
||||
}
|
49
samples/voip/VoIP.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Function prototypes
|
||||
// (I'm too lazy to put them into separate headers...)
|
||||
////////////////////////////////////////////////////////////
|
||||
void DoClient(unsigned short Port);
|
||||
void DoServer(unsigned short Port);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Choose a random port for opening sockets (ports < 1024 are reserved)
|
||||
const unsigned short Port = 2435;
|
||||
|
||||
// Client or server ?
|
||||
char Who;
|
||||
std::cout << "Do you want to be a server ('s') or a client ('c') ? ";
|
||||
std::cin >> Who;
|
||||
|
||||
if (Who == 's')
|
||||
{
|
||||
// Run as a server
|
||||
DoServer(Port);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Run as a client
|
||||
DoClient(Port);
|
||||
}
|
||||
|
||||
// Wait until the user presses 'enter' key
|
||||
std::cout << "Press enter to exit..." << std::endl;
|
||||
std::cin.ignore(10000, '\n');
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
126
samples/win32/Win32.cpp
Normal file
|
@ -0,0 +1,126 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <cmath>
|
||||
|
||||
HWND Button;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Function called whenever one of our windows receives a message
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
LRESULT CALLBACK OnEvent(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam)
|
||||
{
|
||||
switch (Message)
|
||||
{
|
||||
// Quit when we close the main window
|
||||
case WM_CLOSE :
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Quit when we click the "quit" button
|
||||
case WM_COMMAND :
|
||||
{
|
||||
if (reinterpret_cast<HWND>(LParam) == Button)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return DefWindowProc(Handle, Message, WParam, LParam);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \param Instance : Instance of the application
|
||||
///
|
||||
/// \return Error code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
INT WINAPI WinMain(HINSTANCE Instance, HINSTANCE, LPSTR, INT)
|
||||
{
|
||||
// Define a class for our main window
|
||||
WNDCLASS WindowClass;
|
||||
WindowClass.style = 0;
|
||||
WindowClass.lpfnWndProc = &OnEvent;
|
||||
WindowClass.cbClsExtra = 0;
|
||||
WindowClass.cbWndExtra = 0;
|
||||
WindowClass.hInstance = Instance;
|
||||
WindowClass.hIcon = NULL;
|
||||
WindowClass.hCursor = 0;
|
||||
WindowClass.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BACKGROUND);
|
||||
WindowClass.lpszMenuName = NULL;
|
||||
WindowClass.lpszClassName = TEXT("SFML App");
|
||||
RegisterClass(&WindowClass);
|
||||
|
||||
// Let's create the main window
|
||||
HWND Window = CreateWindow(TEXT("SFML App"), TEXT("SFML Win32"), WS_SYSMENU | WS_VISIBLE, 200, 200, 660, 520, NULL, NULL, Instance, NULL);
|
||||
|
||||
// Add a button for exiting
|
||||
Button = CreateWindow(TEXT("BUTTON"), TEXT("Quit"), WS_CHILD | WS_VISIBLE, 560, 440, 80, 40, Window, NULL, Instance, NULL);
|
||||
|
||||
// Let's create two SFML views
|
||||
HWND View1 = CreateWindow(TEXT("STATIC"), NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 20, 20, 300, 400, Window, NULL, Instance, NULL);
|
||||
HWND View2 = CreateWindow(TEXT("STATIC"), NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 340, 20, 300, 400, Window, NULL, Instance, NULL);
|
||||
sf::RenderWindow SFMLView1(View1);
|
||||
sf::RenderWindow SFMLView2(View2);
|
||||
|
||||
// Load some images to display
|
||||
sf::Image Image1, Image2;
|
||||
if (!Image1.LoadFromFile("datas/win32/image1.jpg") || !Image2.LoadFromFile("datas/win32/image2.jpg"))
|
||||
return EXIT_FAILURE;
|
||||
sf::Sprite Sprite1(Image1);
|
||||
sf::Sprite Sprite2(Image2);
|
||||
Sprite1.SetCenter(Sprite1.GetSize() / 2.f);
|
||||
|
||||
// Create a clock for measuring elapsed time
|
||||
sf::Clock Clock;
|
||||
|
||||
// Loop until a WM_QUIT message is received
|
||||
MSG Message;
|
||||
Message.message = static_cast<UINT>(~WM_QUIT);
|
||||
while (Message.message != WM_QUIT)
|
||||
{
|
||||
if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
// If a message was waiting in the message queue, process it
|
||||
TranslateMessage(&Message);
|
||||
DispatchMessage(&Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear views
|
||||
SFMLView1.Clear();
|
||||
SFMLView2.Clear();
|
||||
|
||||
// Draw sprite 1 on view 1
|
||||
Sprite1.SetRotation(Clock.GetElapsedTime() * 100);
|
||||
SFMLView1.Draw(Sprite1);
|
||||
|
||||
// Draw sprite 2 on view 2
|
||||
Sprite2.SetX(cos(Clock.GetElapsedTime()) * 100);
|
||||
SFMLView2.Draw(Sprite2);
|
||||
|
||||
// Display each view on screen
|
||||
SFMLView1.Display();
|
||||
SFMLView2.Display();
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy the main window (all its child controls will be destroyed)
|
||||
DestroyWindow(Window);
|
||||
|
||||
// Don't forget to unregister the window class
|
||||
UnregisterClass(TEXT("SFML App"), Instance);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
samples/window/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = window
|
||||
OBJ = Window.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
window: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-window -lsfml-system -lGLU
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS)
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
118
samples/window/Window.cpp
Normal file
|
@ -0,0 +1,118 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window.hpp>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
///
|
||||
/// \return Application exit code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
int main()
|
||||
{
|
||||
// Create the main window
|
||||
sf::Window App(sf::VideoMode(640, 480, 32), "SFML Window");
|
||||
|
||||
// Create a clock for measuring the time elapsed
|
||||
sf::Clock Clock;
|
||||
|
||||
// Set the color and depth clear values
|
||||
glClearDepth(1.f);
|
||||
glClearColor(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
// Enable Z-buffer read and write
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_TRUE);
|
||||
|
||||
// Setup a perspective projection
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(90.f, 1.f, 1.f, 500.f);
|
||||
|
||||
// Start the game loop
|
||||
while (App.IsOpened())
|
||||
{
|
||||
// Process events
|
||||
sf::Event Event;
|
||||
while (App.GetEvent(Event))
|
||||
{
|
||||
// Close window : exit
|
||||
if (Event.Type == sf::Event::Closed)
|
||||
App.Close();
|
||||
|
||||
// Escape key : exit
|
||||
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
|
||||
App.Close();
|
||||
|
||||
// Resize event : adjust viewport
|
||||
if (Event.Type == sf::Event::Resized)
|
||||
glViewport(0, 0, Event.Size.Width, Event.Size.Height);
|
||||
}
|
||||
|
||||
// Set the active window before using OpenGL commands
|
||||
// It's useless here because the active window is always the same,
|
||||
// but don't forget it if you use multiple windows
|
||||
App.SetActive();
|
||||
|
||||
// Clear color and depth buffer
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Apply some transformations
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.f, 0.f, -200.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
|
||||
glRotatef(Clock.GetElapsedTime() * 90, 0.f, 0.f, 1.f);
|
||||
|
||||
// Draw a cube
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
glColor3f(1.f, 0.f, 0.f);
|
||||
glVertex3f(-50.f, -50.f, -50.f);
|
||||
glVertex3f(-50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, -50.f, -50.f);
|
||||
|
||||
glColor3f(1.f, 0.f, 0.f);
|
||||
glVertex3f(-50.f, -50.f, 50.f);
|
||||
glVertex3f(-50.f, 50.f, 50.f);
|
||||
glVertex3f( 50.f, 50.f, 50.f);
|
||||
glVertex3f( 50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(0.f, 1.f, 0.f);
|
||||
glVertex3f(-50.f, -50.f, -50.f);
|
||||
glVertex3f(-50.f, 50.f, -50.f);
|
||||
glVertex3f(-50.f, 50.f, 50.f);
|
||||
glVertex3f(-50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(0.f, 1.f, 0.f);
|
||||
glVertex3f(50.f, -50.f, -50.f);
|
||||
glVertex3f(50.f, 50.f, -50.f);
|
||||
glVertex3f(50.f, 50.f, 50.f);
|
||||
glVertex3f(50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(0.f, 0.f, 1.f);
|
||||
glVertex3f(-50.f, -50.f, 50.f);
|
||||
glVertex3f(-50.f, -50.f, -50.f);
|
||||
glVertex3f( 50.f, -50.f, -50.f);
|
||||
glVertex3f( 50.f, -50.f, 50.f);
|
||||
|
||||
glColor3f(0.f, 0.f, 1.f);
|
||||
glVertex3f(-50.f, 50.f, 50.f);
|
||||
glVertex3f(-50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, 50.f, -50.f);
|
||||
glVertex3f( 50.f, 50.f, 50.f);
|
||||
|
||||
glEnd();
|
||||
|
||||
// Finally, display the rendered frame on screen
|
||||
App.Display();
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
116
samples/wxwidgets/Main.cpp
Normal file
|
@ -0,0 +1,116 @@
|
|||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include "wxSFMLCanvas.hpp"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Custom SFML canvas
|
||||
////////////////////////////////////////////////////////////
|
||||
class MyCanvas : public wxSFMLCanvas
|
||||
{
|
||||
public :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct the canvas
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
MyCanvas(wxWindow* Parent, wxWindowID Id, const wxPoint& Position, const wxSize& Size, long Style = 0) :
|
||||
wxSFMLCanvas(Parent, Id, Position, Size, Style)
|
||||
{
|
||||
// Load an image and assign it to our sprite
|
||||
myImage.LoadFromFile("datas/wxwidgets/sfml.png");
|
||||
mySprite.SetImage(myImage);
|
||||
mySprite.SetCenter(mySprite.GetSize() / 2.f);
|
||||
|
||||
// Catch the mouse move event
|
||||
Connect(wxEVT_MOTION, wxMouseEventHandler(MyCanvas::OnMouseMove));
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// /see wxSFMLCanvas::OnUpdate
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnUpdate()
|
||||
{
|
||||
// Rotate the sprite
|
||||
if (GetInput().IsMouseButtonDown(sf::Mouse::Left)) mySprite.Rotate( GetFrameTime() * 50);
|
||||
if (GetInput().IsMouseButtonDown(sf::Mouse::Right)) mySprite.Rotate(-GetFrameTime() * 50);
|
||||
|
||||
// Clear the view
|
||||
Clear(sf::Color(0, 128, 128));
|
||||
|
||||
// Display the sprite in the view
|
||||
Draw(mySprite);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Function called when the mouse cursor moves
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void OnMouseMove(wxMouseEvent& Event)
|
||||
{
|
||||
// Make the sprite follow the mouse cursor
|
||||
mySprite.SetX(Event.GetX());
|
||||
mySprite.SetY(Event.GetY());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Member data
|
||||
////////////////////////////////////////////////////////////
|
||||
sf::Image myImage; ///< Some image to load...
|
||||
sf::Sprite mySprite; ///< Something to draw...
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Our main window
|
||||
////////////////////////////////////////////////////////////
|
||||
class MyFrame : public wxFrame
|
||||
{
|
||||
public :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Default constructor : setup the window
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
MyFrame() :
|
||||
wxFrame(NULL, wxID_ANY, wxT("SFML wxWidgets"), wxDefaultPosition, wxSize(680, 280))
|
||||
{
|
||||
// Error log text box
|
||||
wxTextCtrl* ErrorLog = new wxTextCtrl(this, wxID_ANY, wxT(""), wxPoint(440, 20), wxSize(200, 200), wxTE_MULTILINE | wxTE_READONLY | wxHSCROLL);
|
||||
std::cerr.rdbuf(ErrorLog);
|
||||
std::cerr << "-- This is the error log --" << std::endl;
|
||||
|
||||
// Let's create a SFML view
|
||||
new MyCanvas(this, wxID_ANY, wxPoint(20, 20), wxSize(400, 200));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Our application class
|
||||
////////////////////////////////////////////////////////////
|
||||
class MyApplication : public wxApp
|
||||
{
|
||||
private :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Initialize the application
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual bool OnInit()
|
||||
{
|
||||
// Create the main window
|
||||
MyFrame* MainFrame = new MyFrame;
|
||||
MainFrame->Show();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
IMPLEMENT_APP(MyApplication);
|
18
samples/wxwidgets/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
EXEC = wxwidgets
|
||||
OBJ = Main.o wxSFMLCanvas.o
|
||||
|
||||
all: $(EXEC)
|
||||
|
||||
wxwidgets: $(OBJ)
|
||||
$(CC) $(LDFLAGS) -o $(EXECPATH)/$@ $(OBJ) -lsfml-graphics -lsfml-window -lsfml-system `wx-config --libs` `pkg-config --libs gtk+-2.0`
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -o $@ -c $< $(CFLAGS) -I/usr/include/gtk-2.0 `wx-config --cppflags` `pkg-config --cflags gtk+-2.0`
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
clean:
|
||||
@rm -rf *.o
|
||||
|
||||
mrproper: clean
|
||||
@rm -rf $(EXECPATH)/$(EXEC)
|
105
samples/wxwidgets/wxSFMLCanvas.cpp
Normal file
|
@ -0,0 +1,105 @@
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include "wxSFMLCanvas.hpp"
|
||||
|
||||
// Platform-specific includes
|
||||
#ifdef __WXGTK__
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <wx/gtk/win_gtk.h>
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Event table
|
||||
////////////////////////////////////////////////////////////
|
||||
BEGIN_EVENT_TABLE(wxSFMLCanvas, wxControl)
|
||||
EVT_IDLE(wxSFMLCanvas::OnIdle)
|
||||
EVT_PAINT(wxSFMLCanvas::OnPaint)
|
||||
EVT_ERASE_BACKGROUND(wxSFMLCanvas::OnEraseBackground)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct the wxSFMLCanvas
|
||||
////////////////////////////////////////////////////////////
|
||||
wxSFMLCanvas::wxSFMLCanvas(wxWindow* Parent, wxWindowID Id, const wxPoint& Position, const wxSize& Size, long Style) :
|
||||
wxControl(Parent, Id, Position, Size, Style)
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
|
||||
// GTK implementation requires to go deeper to find the low-level X11 identifier of the widget
|
||||
gtk_widget_realize(m_wxwindow);
|
||||
gtk_widget_set_double_buffered(m_wxwindow, false);
|
||||
GdkWindow* Win = GTK_PIZZA(m_wxwindow)->bin_window;
|
||||
XFlush(GDK_WINDOW_XDISPLAY(Win));
|
||||
sf::RenderWindow::Create(GDK_WINDOW_XWINDOW(Win));
|
||||
|
||||
#else
|
||||
|
||||
// Tested under Windows XP only (should work with X11 and other Windows versions - no idea about MacOS)
|
||||
sf::RenderWindow::Create(GetHandle());
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Destructor
|
||||
////////////////////////////////////////////////////////////
|
||||
wxSFMLCanvas::~wxSFMLCanvas()
|
||||
{
|
||||
// Nothing to do...
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Notification for the derived class that moment is good
|
||||
/// for doing its update and drawing stuff
|
||||
////////////////////////////////////////////////////////////
|
||||
void wxSFMLCanvas::OnUpdate()
|
||||
{
|
||||
// Nothing to do by default...
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the control is idle - we can refresh our
|
||||
/// SFML window
|
||||
////////////////////////////////////////////////////////////
|
||||
void wxSFMLCanvas::OnIdle(wxIdleEvent&)
|
||||
{
|
||||
// Send a paint message when the control is idle, to ensure maximum framerate
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the control is repainted - we can display our
|
||||
/// SFML window
|
||||
////////////////////////////////////////////////////////////
|
||||
void wxSFMLCanvas::OnPaint(wxPaintEvent&)
|
||||
{
|
||||
// Make sure the control is able to be repainted
|
||||
wxPaintDC Dc(this);
|
||||
|
||||
// Let the derived class do its specific stuff
|
||||
OnUpdate();
|
||||
|
||||
// Display on screen
|
||||
Display();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the control needs to draw its background
|
||||
////////////////////////////////////////////////////////////
|
||||
void wxSFMLCanvas::OnEraseBackground(wxEraseEvent&)
|
||||
{
|
||||
// Don't do anything. We intercept this event in order to prevent the
|
||||
// parent class to draw the background before repainting the window,
|
||||
// which would cause some flickering
|
||||
}
|
70
samples/wxwidgets/wxSFMLCanvas.hpp
Normal file
|
@ -0,0 +1,70 @@
|
|||
|
||||
#ifndef WXSFMLCANVAS_HPP
|
||||
#define WXSFMLCANVAS_HPP
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <wx/wx.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// wxSFMLCanvas allows to run SFML in a wxWidgets control
|
||||
////////////////////////////////////////////////////////////
|
||||
class wxSFMLCanvas : public wxControl, public sf::RenderWindow
|
||||
{
|
||||
public :
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Construct the wxSFMLCanvas
|
||||
///
|
||||
/// \param Parent : Parent of the control (NULL by default)
|
||||
/// \param Id : Identifier of the control (-1 by default)
|
||||
/// \param Position : Position of the control (wxDefaultPosition by default)
|
||||
/// \param Size : Size of the control (wxDefaultSize by default)
|
||||
/// \param Style : Style of the control (0 by default)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
wxSFMLCanvas(wxWindow* Parent = NULL, wxWindowID Id = -1, const wxPoint& Position = wxDefaultPosition, const wxSize& Size = wxDefaultSize, long Style = 0);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Destructor
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual ~wxSFMLCanvas();
|
||||
|
||||
private :
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Notification for the derived class that moment is good
|
||||
/// for doing its update and drawing stuff
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual void OnUpdate();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the window is idle - we can refresh our
|
||||
/// SFML window
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void OnIdle(wxIdleEvent&);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the window is repainted - we can display our
|
||||
/// SFML window
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void OnPaint(wxPaintEvent&);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Called when the window needs to draw its background
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void OnEraseBackground(wxEraseEvent&);
|
||||
};
|
||||
|
||||
|
||||
#endif // WXSFMLCANVAS_HPP
|