Coder Social home page Coder Social logo

passfml's Introduction

PasSFML - Simple and Fast Multimedia Library for Pascal

SFML is a simple, fast, cross-platform and object-oriented multimedia API. It provides access to windowing, graphics, audio and network. It is originally written in C++, and this project is an inofficial binding for the Pascal language. It makes use of the C wrappers from the CSFML bindings.

You can find SFML here: http://www.sfml-dev.org/

SFML is released under the the zlib/png+ license. The license can be optained here: http://opensource.org/licenses/Zlib

Authors

Download

You can get the current development version from the git repository (https://github.com/CWBudde/PasSFML).

Compiler

Currently Delphi and FPC/Lazarus are supported. However, due to a compiler incompatibility with the Delphi compiler (solved with workarounds), FPC is recommended at the moment.

Remarks

For Linux development it is necessary to also install the libcsfml-dev package.

Learn

There is no tutorial for PasSFML, but since it's a binding you can use the C++ resources:

Contribute

SFML and PasSFML are open-source projects, and they need your help to go on growing and improving. Don't hesitate to post suggestions or bug reports on the forum (http://en.sfml-dev.org/forums/), submit patches by e-mail, or post new bugs/features requests on the task tracker (https://github.com/CWBudde/PasSFML/issues/). You can even fork the project on GitHub, maintain your own version and send us pull requests periodically to merge your work.

passfml's People

Contributors

cwbudde avatar nalilord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

passfml's Issues

sfml libraries on ubuntu

Hello I am trying lazarus and sfml on ubuntu 16 I already installed sfml package but it does no work
The error is:
/usr/bin/ld: can not found -lcsfml-window
/usr/bin/ld: can not found -lcsfml-system

I need you help.
regards.....

MouseMoved event is not working properly.

The MouseMoved event is not working properly (http://www.sfml-dev.org/tutorials/2.3/window-events.php#the-mousemoved-event).

Event is only fired when pressing a mouse button. Mouse X value maps to Event.MouseMove.Y. Event.MouseMove.X is always zero.

OS: GNU/Linux 4.1.4-1 (Arch Linux x86_64; SFML 2.3.1; CSFML 2.3)

program MouseMove;

uses
  SfmlSystem in '../PasSFML/Source/SfmlSystem.pas',
  SfmlWindow in '../PasSFML/Source/SfmlWindow.pas';

var
  Window: TSfmlWindow;
  Event: TSfmlEvent;

begin
  Window := TSfmlWindow.Create(SfmlVideoMode(800, 600), 'MouseMove', [sfClose]);

  while Window.IsOpen do
  begin
    while Window.PollEvent(Event) do
    begin
      if Event.EventType = sfEvtMouseMoved then
      begin
        WriteLn('X: ', Event.MouseMove.X);
        WriteLn('Y: ', Event.MouseMove.Y);
      end;
    end;
  end;
end.

SfmlNetwork missing functions

Hello,
Some functions are missing from file SfmlNetwork.pas:

  • sfTcpSocket_sendPartial - TcpSocket.h;
  • sfSocketSelector_addTcpSocket - SocketSelector.h
  • sfSocketSelector_addUdpSocket - SocketSelector.h
  • sfSocketSelector_removeTcpSocket - SocketSelector.h
  • sfSocketSelector_removeUdpSocket - SocketSelector.h

I have them implemented in my copy, but I don't know how to pass them to you.
Any advice ?

Textures not working with TSfmlVertexArray

I have written a small FPC project which attempted to load a texture into a TVertexArray and display it, along with a couple other reference graphics. I have a TCircleShape with a texture that displays just fine and a TVertexArray with colors on the vertices which displays very well. However, the textured vertex array does not. I made sure that the VA would display without the texture very simply by removing the pointer to the Render State in the Draw command. It shows just fine with a color, but nothing is displayed with a texture. I have also played with the texture coordinates on the vertices, thinking that maybe I should define a standard rectangle instead of texture coordinates that mimic the shape of the VA.

Code and a snapshot of the running code with the reference texture file (in Gimp) are attached. Sadly, the lpr file had to be given a TXT extension in order to attach. To keep the attachments under control, I did not include the SFML dll files and the Arial font file. All the code resides in just the lpr file. I am currently using Lazarus 1.6 on a Windows 10 machine. The project is configured to be a Win64 exe and -WG is turned on.

I would really like to find out that this is just a simple coding issue, but I have been playing with this for a while, getting nowhere and finding nothing online about it. Any and all help will be greatly appreciated.

Texture:
swish

Snapshot:
ss_160923_151921

Code:
textureloadtest.lpr.txt

RUN VOIP project

the sentence
inherited Create(OnGetDataHandler, OnSeekHandler, 1, 44100, Self); is worng

[dcc32 Error] Server.pas(63): E2010 Incompatible types: 'LongBool' and 'Boolean'

HelloWorld and HelloWorldOOP raise an exception on the Surface device vertically oriented.

HelloWorld and HelloWorldOOP raise an exception on the Surface device vertically oriented.

According to SFML Documentation (SFML-2.3\classsf_1_1VideoMode.html): Video modes are used to setup windows (sf::Window) at creation time. The main usage of video modes is for fullscreen mode: indeed you must use one of the valid video modes allowed by the OS (which are defined by what the monitor and the graphics card support), otherwise your window creation will just fail.

Testing if Video Mode is valid for a windowed Window is not appropriate.

Please review the following patches:

diff --git a/Examples/Hello World/HelloWorld.dpr b/Examples/Hello World/HelloWorld.dpr
index 03999c2..1ae70bc 100644
--- a/Examples/Hello World/HelloWorld.dpr   
+++ b/Examples/Hello World/HelloWorld.dpr   
@@ -22,8 +22,6 @@ begin
   Mode.Width := 800;
   Mode.Height := 600;
   Mode.BitsPerPixel := 32;
-  if not SfmlVideoModeIsValid(Mode) then
-    raise Exception.Create('Invalid video mode');

   Window := SfmlRenderWindowCreate(Mode, 'SFML Window', [sfResize, sfClose], nil);
   if not Assigned(Window) then 
diff --git a/Examples/Hello World (OOP)/HelloWorld.dpr b/Examples/Hello World (OOP)/HelloWorld.dpr
index 618703a..86b7bca 100644
--- a/Examples/Hello World (OOP)/HelloWorld.dpr 
+++ b/Examples/Hello World (OOP)/HelloWorld.dpr 
@@ -22,8 +22,6 @@ begin
   Mode.Width := 800;
   Mode.Height := 600;
   Mode.BitsPerPixel := 32;
-  if not SfmlVideoModeIsValid(Mode) then
-    raise Exception.Create('Invalid video mode');

   Window := TSfmlRenderWindow.Create(Mode, AnsiString('SFML Window'),
     [sfResize, sfClose], nil); 

SfmlNetwork.pas issues

Issue 1:
I think that TSfmlSocketStatus should be:

TSfmlSocketStatus = (sfSocketDone, sfSocketNotReady, sfSocketPartial,
    sfSocketDisconnected, sfSocketError);

instead of

TSfmlSocketStatus = (sfSocketDone, sfSocketNotReady, sfSocketDisconnected,
    sfSocketError);

Issue 2:
For all port values a byte is used. Ports can have numbers between 0..65535 and the equivalent of an unsigned short in C and C++ for Delphi and Lazarus/Fpc is a word.

Is this correct or I am wrong ?
I am using V2.3 binaries with Lazarus 1.4.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.