Giter Site home page Giter Site logo

wrap_sdl's Introduction

wrap_sdl

wrap_sdl is an Eiffel binding of SDL API using WrapC tool.

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.

Requirements

Download and Install

Check the following link to learn more about SDL installation https://wiki.libsdl.org/Installation

Linux

SDL

Download the release-2.0.12 https://hg.libsdl.org/SDL

tar -xvf SDL-355a4f94a782.tar.gz

cd  SDL-355a4f94a782

mkdir build
cd build
../configure
make
sudo make install

Rebuild the ldconfig cache using

sudo ldconfig 

SDL_image

Download the release-2.0.12 https://hg.libsdl.org/SDL_image/

tar -xvf SDL_image-59a4c1ea96f3.tar.gz

cd  SDL_image-59a4c1ea96f3

mkdir build
cd build
../configure
make
sudo make install

Rebuild the ldconfig cache using

sudo ldconfig 

Optionally you can use vckpg, a C++ Library Manager for Windows, Linux, and MacOS.

Windows

Using vcpkg (https://github.com/microsoft/vcpkg) tool, you can install lib sdl2 library

vcpkg install sdl2:x64-windows
vcpkg install sdl2-image:x64-windows

On windows you will need to copy SDL2.lib to PROJECT_PATH\sdl\C\lib and SDL2_image.lib to PROJECT_PATH\sdl_image\C\lib Be sure to have the dll's on th PATH before to run the example. At the moment there is no support for static linking with wrap_sdl project.

Status

Work in progress

Generate the SDL Eiffel wrapper code.

It's recommended to generate the code yourself instead of use the generated code. To do that just run the following script. Before to run it, double check you have the required dependencies.

Windows

install.bat

Linux

./install.sh

This script will generate the wrapper and also will compile the C library glue code, required to execute the examples.

Examples

The examples are based on the following SDL tutorial http://lazyfoo.net/tutorials/SDL/index.php

How to compile the C library glue code.

Before to use the examples you will need to compile the C glue code, go to

sld/generated_wrapper/c/src

and

sld_image/generated_wrapper/c/src

and run

finish_freezing --library

It will copy the C lib eif_sdl.a to $ECF_CONFIG_PATH/C/spec/$(ISE_PLATFORM)/lib/ or eif_sdl.lib to $ECF_CONFIG_PATH/C/spec/$ISE_C_COMPILER/$ISE_PLATFORM/lib

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.