pp 0.0.3-alpha.2

The base library of the polyplex engine. (Heavily WIP, non-idiomatic)


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

This package provides sub packages which can be used individually:

pp:derelict-util - Cross-platform shared library loader and a number of utility modules used by the Derelict libraries.

pp:derelict-sdl2 - Dynamic bindings to SDL2, SDL2_image, SDL2_mixer, SDL2_ttf and SDL2_net.

pp:derelict-gl3 - A dynamic binding to the OpenGL library.

pp:derelict-al - A dynamic binding to the OpenAL api.

pp:derelict-vulkan - A dynamic binding to the vulkan api.

Polyplex Logo

Polyplex Main Library (libpp)

<a href="https://www.patreon.com/bePatron?u=10156994" data-patreon-widget-type="become-patron-button"><img class="s5qsvfm-0 fIpNGV" src="https://c5.patreon.com/external/logo/becomeapatronbutton.png"></a></img> <a href='https://ko-fi.com/O4O59UGN' target='blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0' border='0' alt='Buy Clipsey a Coffee at ko-fi.com' /></a> Join the Discord Server

libpp is an XNA like framework written in D. libpp supports OpenGL and will in the future support Vulkan.

The framework is written to be easy to read and understand for people comming from an C#/XNA background.

libpp is the base rendering, input handling, content handling, etc. library for the WIP Polyplex engine.

Top Tier Patrons

  • The Linux Gamer Community

Using libpp

Find libpp on the dub database for instructions on adding libpp as a dependency to your dub project.

Once added, you will need to set logging levels, choose a backend and create a window.

Current capabilities

Polyplex is still very early in development, but libpp can already be used to make simple 2D games, that are relatively easy to port to other platforms. Polyplex packages textures, sounds, etc. into files with the extension ppc. To convert ogg, png, jpeg or tga files to .ppc, use ppcc

Examples

PPCC

ppcc -c (or --convert) my_file.(extension) output will be put in my_file.ppc.

From libpp it can be accessed via ContentManager.Load<Type>("my_file")

libpp

Example of simple polyplex application:

import polyplex;
import polyplex.math;
import polyplex.core.window;
import polyplex.core.input;
import polyplex.core.game;
import polyplex.core.color;
import polyplex.core.render;
import polyplex.core.content;
import std.conv;

void main(string[] args) {
  // Show info logs.
  LogLevel |= LogType.Info;
  
  // libpp now has a simple game launcher
  // It will automatically choose the graphics API most suitable.
  BasicGameLauncher.InitSDL();
  BasicGameLauncher.LaunchGame(new Game1(), args);
}

class Game1 : Game {
  Texture2D my_texture;

  // Constructor
  this() {
    WindowInfo inf = new WindowInfo();
    inf.Name = "Game1";
    inf.Bounds = new Rectangle(WindowPosition.Undefined, WindowPosition.Undefined, 1080, 1024);
    super(inf);
  }
  
  //Init is run before the game loop starts.
  public override void Init() {
    my_texture = this.Content.LoadTexture("my_texture");
  }
  
  //Update is run before draw in the game loop.
  public override void Update(GameTimes game_time) {
    // Quit game if Q is pressed.
    if (Keyboard.GetState().IsKeyDown(Keys.Q)) this.Quit();
    
    //FPS counter as window title.
    Window.Title = "FPS: " ~ to!string(AverageFPS);
  }
  
  //Draw is run after the logic update of the game loop.
  public override void Draw(GameTimes game_time) {
  
    //Clears color, generally put first in the Draw method.
    Drawing.ClearColor(Color.Black);
    
    sprite_batch.Begin();
    sprite_batch.Draw(my_texture, new Rectangle(0, 0, 32, 32), texture.Size, Color.White);
    sprite_batch.End();
  }
}

You can also check out example_game, which is used as a testbed for new libpp features/fixes.

Notice

The library is written in what would be considered non-idiomatic D.
Sub packages:
pp:derelict-util, pp:derelict-sdl2, pp:derelict-gl3, pp:derelict-al, pp:derelict-vulkan
Dependencies:
pp:derelict-gl3, pp:derelict-al, pp:derelict-util, pp:derelict-vulkan, pp:derelict-sdl2, ppc, sharpevents, colorize
Versions:
0.0.3-alpha.2 2018-Jun-12
0.0.3-alpha.1 2018-May-19
0.0.2-alpha.8 2018-May-12
0.0.2-alpha.7 2018-Apr-15
0.0.2-alpha.6 2018-Apr-06
Show all 12 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 2 downloads this month

  • 72 downloads total

Score:
1.0
Short URL:
pp.dub.pm