Git Product home page Git Product logo

go-sfml's Introduction

go-sfml

Go bindings for SFML, the Simple and Fast Multimedia Library, version 2.5.1

Originally made by teh-cmc

These bindings are entirely generated using SWIG and the official C bindings of SFML.
Hence they should be fairly easy to maintain & keep in sync with future releases from upstream

Table of Contents


Portability

I have only tested these on Windows 10

Feel free to open issues and/or PRs if you're running into problems on other platforms

Usage

Installation

First setup

I'll cover Windows in this section (I build go-sfml using WSL, but build my go apps on Windows)

  1. Download CSFML 2.5.1 and extract it wherever you like (assuming C:\CSFML_2.5.1 for the next steps). I'm downloading the 64 bits version since I'm on a 64 bits Windows
  2. Download and install the GCC compiler (in my case, the mingw x86_64-win32-sjlj one)
  3. We now need to define the CGO_CFLAGS and CGO_LDFLAGS environment variables so the linker knows where the CSFML headers and compiled libraries are at

Assuming CSFML is extracted at C:\CSFML_2.5.1, we can run the following in a command line :

set CGO_CFLAGS="-IC:\CSFML_2.5.1\include"
set CGO_LDFLAGS="-LC:\CSFML_2.5.1\lib\gcc"

Feel free to set those variables system-wide so you don't have to define them on the fly everytime

Notice the -I and -L before the paths, with no whitespace in between

  1. Build the example to ensure your setup is working
cd examples/basic_window
go get && go build
  1. Copy the CSFML DLLs next to your executable, for the basic example we only need csfml-window-2.dll and csfml-graphics-2.dll that you'll find into C:\CSFML_2.5.1\bin
  2. Run the exe, a red window should appear!

Get the module

For future projects, simply run

go get github.com/telroshan/go-sfml/v2

And import the modules you need

import (
  "github.com/telroshan/go-sfml/v2/graphics"
  "github.com/telroshan/go-sfml/v2/window"
  "github.com/telroshan/go-sfml/v2/system"
  "github.com/telroshan/go-sfml/v2/audio"
)

Troubleshooting

Error: SFML/Window.h: No such file or directory

→ Make sure you have downloaded the CSFML version that matches your system (don't download the 32 bits one if you're on a 64 bits Windows)

→ Make sure you included the subfolder matching your compiler (gcc here) for CGO_LDFLAGS, and didn't make it point to the lib root folder itself

→ Make sure you defined the environment variables in the same command line that you ran go build into (the variables defined with the set command won't exist outside of the command line they've been set into)

→ Make sure you typed the variable names correctly, i.e CGO_CFLAGS and CGO_LDFLAGS

→ Make sure you didn't invert the paths between the two variables. CGO_CFLAGS should point to the include folder whereas CGO_LDFLAGS should point to the libs

→ Make sure you made no typo with the syntax of -I and -L for those variables

Error: imports github.com/telroshan/go-sfml/v2/window: build constraints exclude all Go files in [...]

→ You need to define the environment variable CGO_ENABLED. As the doc says:

The cgo tool is enabled by default for native builds on systems where it is expected to work. It is disabled by default when cross-compiling. You can control this by setting the CGO_ENABLED environment variable when running the go tool: set it to 1 to enable the use of cgo, and to 0 to disable it.

set CGO_ENABLED=1
Error: csfml-window-2.dll could not be found

→ You probably didn't copy CSFML DLLs next to your executable, as mentioned in step 5

Bat script

Alternatively to steps 3 to 5 from the previous section, you could use a bat script to automate that process for you, such as the one in the basic window example

@ECHO OFF

rem This script sets the environment variables to be able to build the app, and copies the CSFML DLLs over if there aren't any in the folder

rem Edit the CSFML_PATH variable to match the path of your CSFML installation
set CSFML_PATH=C:\CSFML_2.5.1
rem Edit the COMPILER_NAME variable if you're not using gcc
set COMPILER_NAME=gcc

set CGO_CFLAGS="-I%CSFML_PATH%\include"
set CGO_LDFLAGS="-L%CSFML_PATH%\lib\%COMPILER_NAME%"

go get
if %ERRORLEVEL% NEQ 0 (echo go get failed && exit /b %ERRORLEVEL%)

go build
if %ERRORLEVEL% NEQ 0 (echo go build failed && exit /b %ERRORLEVEL%)

echo Build complete

if not exist "%~dp0*.dll" (
  echo No DLLs in folder, getting them from CSFML folder
  xcopy /s "%CSFML_PATH%\bin" "%~dp0"
  if %ERRORLEVEL% NEQ 0 (echo failed to copy DLLs && exit /b %ERRORLEVEL%)
)

API

The generated APIs very closely follow those of SFML's C bindings: the tutorials & documentation available for the official C++ implementation, as well as an editor with a well configured Go-autocompletion, will get you a long way

Modules

The original C & C++ implementations of SFML come with 5 modules: Audio, Graphics, Network, System and Window

Of these 5 modules:

  • Audio, Graphics & Window come with complete Go packages counterparts
  • System also has a dedicated Go package, but only contains the sfVector2 & sfVector3 classes; everything else is already available in one form or another in Go's standard library
  • Network has been entirely discard, use Go's standard library instead

Examples

Basic example

Here's a straightforward example of creating a window and handling events:

package main

import (
	"runtime"

	"github.com/telroshan/go-sfml/v2/graphics"
	"github.com/telroshan/go-sfml/v2/window"
)

func init() { runtime.LockOSThread() }

func main() {
	vm := window.NewSfVideoMode()
	defer window.DeleteSfVideoMode(vm)
	vm.SetWidth(800)
	vm.SetHeight(600)
	vm.SetBitsPerPixel(32)

	/* Create the main window */
	cs := window.NewSfContextSettings()
	defer window.DeleteSfContextSettings(cs)
	w := graphics.SfRenderWindow_create(vm, "SFML window", uint(window.SfResize|window.SfClose), cs)
	defer window.SfWindow_destroy(w)

	ev := window.NewSfEvent()
	defer window.DeleteSfEvent(ev)

	/* Start the game loop */
	for window.SfWindow_isOpen(w) > 0 {
		/* Process events */
		for window.SfWindow_pollEvent(w, ev) > 0 {
			/* Close window: exit */
			if ev.GetEvType() == window.SfEventType(window.SfEvtClosed) {
				return
			}
		}
		graphics.SfRenderWindow_clear(w, graphics.GetSfRed())
		graphics.SfRenderWindow_display(w)
	}
}

For comparison's sake, the exact same thing in C:

#include <SFML/Window.h>
#include <SFML/Graphics.h>

int main() {
    sfVideoMode mode = {800, 600, 32};
    sfRenderWindow* window;
    sfEvent event;

    /* Create the main window */
    window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, NULL);
    if (!window)
        return 1;

    /* Start the game loop */
    while (sfRenderWindow_isOpen(window)) {
        /* Process events */
        while (sfRenderWindow_pollEvent(window, &event)) {
            /* Close window : exit */
            if (event.type == sfEvtClosed)
                sfRenderWindow_close(window);
        }
        /* Clear the screen */
        sfRenderWindow_clear(window, sfRed);
        sfRenderWindow_display(window);
    }

    /* Cleanup resources */
    sfRenderWindow_destroy(window);
}

Other examples

You'll find other examples in the examples folder

  1. Basic window : just the same as above
  2. Tennis : go version of SFML's tennis example

Feel free to open PRs if you have any example you'd like to share!

Building go-sfml

If you just want to use go-sfml for SFML 2.5.1 into your go project, you may want to read the Usage section instead

If you want to build your own bindings for a different version of SFML, then this section is for you!

Note: the following steps were realized in Windows' Ubuntu bash. Feel free to open issues and/or PRs if you're running into problems on other Unix-based platforms

Download & compile SFML + CSFML

  1. Install SFML dependencies first
  2. Run the sfml.sh script to handle the process of downloading SFML/CSFML and compiling them for you

Troubleshooting

Error: /usr/bin/env: ‘bash\r’: No such file or directory

→ You're probably having CRLF issues (happened to me when cloning the repo on Windows initially before switching to WSL)

→ Use dos2unix (install it if you don't have the command) on the 3 scripts : dos2unix sfml.sh swig.sh build.sh

Error: CMake Error [...] Could not find X11 (or a similar error with just another name instead of X11)
Could not find X11
Call Stack (most recent call first):
  src/SFML/Window/CMakeLists.txt (find_package)

→ You probably didn't install every SFML dependency. Don't forget the development headers as well! For example on Ubuntu, you'll want to install libx11-dev, xorg-dev, libudev-dev, and so on

Setup swig

Option 1 - Install it from your package manager

  1. Depending on your platform, you may simply download the available package. For example on Ubuntu, sudo apt install swig

Option 2 - Build it locally

  1. Run sudo apt install libpcre3-dev (swig requires this package)
  2. Run the swig.sh script
  3. Check where swig thinks its lib is, by running ./swig/swig -swiglib. It should output ${path/to/go-sfml}/swig/Lib
  4. If the output doesn't match, fix that by overriding the SWIG_LIB environment variable. You may run export SWIG_LIB=${path/to/go-sfml}/swig/Lib to override the var just for your current session, or make it persistent
  5. Run ./swig/swig -swiglib again to ensure swig has the correct path to its own lib
  6. Update the build.sh script and change the line 23 : the script is looking for a global command swig, you must replace that path by ./swig/swig to use the local build instead

Troubleshooting

Error: /usr/bin/env: ‘bash\r’: No such file or directory

→ You're probably having CRLF issues (happened to me when cloning the repo on Windows initially before switching to WSL)

→ Use dos2unix (install it if you don't have the command) on the 3 scripts : dos2unix sfml.sh swig.sh build.sh

Error: Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)

→ You probably didn't install libpcre3-dev as mentioned in step 1. Run sudo apt install libpcre3-dev and try again

Build go bindings

  1. Run sudo apt install patchelf (the build script uses this package to fix the missing links from the built CSFML libraries to the SFML ones)
  2. Run build.sh

Troubleshooting

Error: /usr/bin/env: ‘bash\r’: No such file or directory

→ You're probably having CRLF issues (happened to me when cloning the repo on Windows initially before switching to WSL)

→ Use dos2unix (install it if you don't have the command) on the 3 scripts : dos2unix sfml.sh swig.sh build.sh

Error: swig: command not found

→ You probably either did not install the swig package, or built it locally but forgot to follow the step 6 to update the path used by the build.sh script

Error: Unable to find 'swig.swg'

→ You probably went for the swig local build, but didn't check for its lib path. Please follow steps 3 to 5 of that section

Error: patchelf: command not found

→ You probably didn't install patchelf as mentioned in step 1

You're now ready to go!

Feel free to open issues and/or PRs if you're running into problems that are not mentioned in the troubleshooting sub-sections

go-sfml's People

Contributors

teh-cmc avatar telroshan 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  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

go-sfml's Issues

"Undefined reference to" errors when compiling basic_window example on Ubuntu 22.04

Output of go build or go run

# basic_window
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlendAlpha_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0xc9d): undefined reference to `sfBlendAlpha'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlendAdd_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0xced): undefined reference to `sfBlendAdd'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlendMultiply_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0xd3d): undefined reference to `sfBlendMultiply'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlendNone_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0xd8d): undefined reference to `sfBlendNone'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlack_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1d70): undefined reference to `sfBlack'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlack_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1da5): undefined reference to `sfBlack'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfWhite_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1dee): undefined reference to `sfWhite'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfWhite_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1e23): undefined reference to `sfWhite'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfRed_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1e6c): undefined reference to `sfRed'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfRed_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1ea1): undefined reference to `sfRed'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfGreen_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1eea): undefined reference to `sfGreen'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfGreen_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1f1f): undefined reference to `sfGreen'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlue_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1f68): undefined reference to `sfBlue'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfBlue_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1f9d): undefined reference to `sfBlue'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfYellow_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x1fe6): undefined reference to `sfYellow'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfYellow_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x201b): undefined reference to `sfYellow'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfMagenta_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x2064): undefined reference to `sfMagenta'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfMagenta_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x2099): undefined reference to `sfMagenta'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfCyan_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x20e2): undefined reference to `sfCyan'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfCyan_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x2117): undefined reference to `sfCyan'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfTransparent_set_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x2160): undefined reference to `sfTransparent'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfTransparent_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0x2195): undefined reference to `sfTransparent'
/usr/bin/ld: /tmp/go-link-1656247100/000002.o: in function `_wrap_sfTransform_Identity_get_graphics_0e245b41439e98a6':
Graphics_wrap.c:(.text+0xd528): undefined reference to `sfTransform_Identity'
collect2: error: ld returned 1 exit status

output of go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tomcroasdale/.cache/go-build"
GOENV="/home/tomcroasdale/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/tomcroasdale/go/pkg/mod"
GONOPROXY="github.com/Gigfinder-io/*"
GONOSUMDB="github.com/Gigfinder-io/*"
GOOS="linux"
GOPATH="/home/tomcroasdale/go"
GOPRIVATE="github.com/Gigfinder-io/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.7"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/tomcroasdale/go-sfml/examples/basic_window/go.mod"
GOWORK=""
CGO_CFLAGS="-I/home/tomcroasdale/SFML/2.5.1/include -w"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-L/home/tomcroasdale/SFML/2.5.1/lib/gcc"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1250995538=/tmp/go-build -gno-record-gcc-switches"

graphics.SfRenderWindow_drawText should accept a nil parameter for RenderStates

This would be more consistent with the underlying CSFML behavior, which allows you to pass in NULL for the third parameter. It's quite cumbersome to figure out how to create a default RenderStates struct that would cause the text to appear. I haven't been able to figure it out, and all of the tutorials on the SFML website simply don't use RenderStates. Example:

package main

import (
	"runtime"
	"gopkg.in/teh-cmc/go-sfml.v24/graphics"
	"gopkg.in/teh-cmc/go-sfml.v24/window"
	"gopkg.in/teh-cmc/go-sfml.v24/system"
)

func init() {
	runtime.LockOSThread()
}

func main() {
	videoMode := window.NewSfVideoMode()
	defer window.DeleteSfVideoMode(videoMode)

	videoMode.SetWidth(800)
	videoMode.SetHeight(600)
	videoMode.SetBitsPerPixel(32)

	contextSettings := window.NewSfContextSettings()
	defer window.DeleteSfContextSettings(contextSettings)
	renderingWindow := graphics.SfRenderWindow_create(
		videoMode,
		"RPG",
		uint(window.SfResize|window.SfClose),
		contextSettings)
	defer window.SfWindow_destroy(renderingWindow)

	event := window.NewSfEvent()
	defer window.DeleteSfEvent(event)

	font := graphics.SfFont_createFromFile("Arial.ttf")
	defer graphics.SfFont_destroy(font)

	text := graphics.SfText_create()
	defer graphics.SfText_destroy(text)

	vector := system.NewSfVector2f()
	defer system.DeleteSfVector2f(vector)

	for window.SfWindow_isOpen(renderingWindow) > 0 {
		for window.SfWindow_pollEvent(renderingWindow, event) > 0 {
			if event.GetXtype() == window.SfEventType(window.SfEvtClosed) {
				return
			}
		}
		graphics.SfRenderWindow_clear(renderingWindow, graphics.SfColor_fromRGB(69, 67, 67))
		// Write Hello world! to the screen
		graphics.SfText_setFont(text, font)
		graphics.SfText_setFillColor(text, graphics.GetSfWhite())
		graphics.SfText_setCharacterSize(text, 24)
		graphics.SfText_setString(text, "Hello world!")
		vector.SetX(400)
		vector.SetY(300)
		graphics.SfText_setPosition(text, vector)
                // Crashed because 3rd parameter is nil
		graphics.SfRenderWindow_drawText(renderingWindow, text, nil)
		graphics.SfRenderWindow_display(renderingWindow)
	}
}

Consider renaming examples/go

Running go get -u gopkg.in/teh-cmc/go-sfml.v24/... compiles and installs the go example into $GOPATH/bin. For users with $GOPATH/bin in their $PATH, the go example program may gain precedence over the go tool of the Go distribution.

(Win64) Incompatible type for argument 3 of 'sfRenderTexture_createWithSettings'

When building basic_window example (Win10 64bit) there is a compilation error:

Graphics_wrap.c: In function '_wrap_sfRenderTexture_createWithSettings_graphics_0e245b41439e98a6':
Graphics_wrap.c:4902:76: error: incompatible type for argument 3 of 'sfRenderTexture_createWithSettings'
 4902 |   result = (sfRenderTexture *)sfRenderTexture_createWithSettings(arg1,arg2,(sfContextSettings const *)arg3);
      |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                            |
      |                                                                            const sfContextSettings *
In file included from d:\development\libs\CSFML\include/SFML/Graphics.h:45:
d:\development\libs\CSFML\include/SFML/Graphics/RenderTexture.h:68:131: note: expected 'sfContextSettings' but argument is of type 'const sfContextSettings *'
   68 | CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_createWithSettings(unsigned int width, unsigned int height, sfContextSettings settings);
      |
~~~~~~~~~~~~~~~~~~^~~~~~~~

sfRenderTexture_createWithSettings in CSFML RenderTexture.h is indeed declared as accepting value object sfContextSettings, not the const pointer.

A lot of compilation warnings on Ubuntu 20.04

I started using your project inside mine, a porting in go of a N-bodies simulation.
When i run go build or go test or go run i get all these compilation warnings:

# gopkg.in/teh-cmc/go-sfml.v24/graphics
Graphics_wrap.c: In function ‘_wrap_sfRenderWindow_capture_graphics_23698568018502eb’:
Graphics_wrap.c:5697:3: warning: ‘sfRenderWindow_capture’ is deprecated [-Wdeprecated-declarations]
 5697 |   result = (sfImage *)sfRenderWindow_capture((struct sfRenderWindow const *)arg1);
      |   ^~~~~~
In file included from /usr/include/SFML/Graphics.h:46,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/RenderWindow.h:556:46: note: declared here
  556 | CSFML_GRAPHICS_API CSFML_DEPRECATED sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
      |                                              ^~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloatParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6405:3: warning: ‘sfShader_setFloatParameter’ is deprecated [-Wdeprecated-declarations]
 6405 |   sfShader_setFloatParameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:421:42: note: declared here
  421 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloat2Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6426:3: warning: ‘sfShader_setFloat2Parameter’ is deprecated [-Wdeprecated-declarations]
 6426 |   sfShader_setFloat2Parameter(arg1,(char const *)arg2,arg3,arg4);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:444:42: note: declared here
  444 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloat3Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6449:3: warning: ‘sfShader_setFloat3Parameter’ is deprecated [-Wdeprecated-declarations]
 6449 |   sfShader_setFloat3Parameter(arg1,(char const *)arg2,arg3,arg4,arg5);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:468:42: note: declared here
  468 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setFloat4Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6474:3: warning: ‘sfShader_setFloat4Parameter’ is deprecated [-Wdeprecated-declarations]
 6474 |   sfShader_setFloat4Parameter(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:493:42: note: declared here
  493 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setVector2Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6500:3: warning: ‘sfShader_setVector2Parameter’ is deprecated [-Wdeprecated-declarations]
 6500 |   sfShader_setVector2Parameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:516:42: note: declared here
  516 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setVector3Parameter_graphics_23698568018502eb’:
Graphics_wrap.c:6526:3: warning: ‘sfShader_setVector3Parameter’ is deprecated [-Wdeprecated-declarations]
 6526 |   sfShader_setVector3Parameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:539:42: note: declared here
  539 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setColorParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6552:3: warning: ‘sfShader_setColorParameter’ is deprecated [-Wdeprecated-declarations]
 6552 |   sfShader_setColorParameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:567:42: note: declared here
  567 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setTransformParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6578:3: warning: ‘sfShader_setTransformParameter’ is deprecated [-Wdeprecated-declarations]
 6578 |   sfShader_setTransformParameter(arg1,(char const *)arg2,arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:590:42: note: declared here
  590 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setTextureParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6597:3: warning: ‘sfShader_setTextureParameter’ is deprecated [-Wdeprecated-declarations]
 6597 |   sfShader_setTextureParameter(arg1,(char const *)arg2,(struct sfTexture const *)arg3);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:623:42: note: declared here
  623 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Graphics_wrap.c: In function ‘_wrap_sfShader_setCurrentTextureParameter_graphics_23698568018502eb’:
Graphics_wrap.c:6614:3: warning: ‘sfShader_setCurrentTextureParameter’ is deprecated [-Wdeprecated-declarations]
 6614 |   sfShader_setCurrentTextureParameter(arg1,(char const *)arg2);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/SFML/Graphics.h:47,
                 from Graphics_wrap.c:229:
/usr/include/SFML/Graphics/Shader.h:646:42: note: declared here
  646 | CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What am I doing wrong?

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.