Drawing a Sexy Polygon

In the beginning there is the "Hello World" example. In Slut this can mean drawing a simple polygon into Euclidean space.

from slut import *

class Atlantis(World):
    def onSetup(self):
        self.width = 400
        self.height = 300
        self.name = "Hello World"

    def onDraw(self):
        glBegin(GL_LINE_STRIP)
        glVertex3f(0.0, 0.0, 0.0)
        glVertex3f(1.0, 0.0, 0.0)
        glVertex3f(1.0, 1.0, 0.0)
        glVertex3f(-0.5, 1.5, 0.0)
        glVertex3f(0.0, 0.0, 0.0)
        glEnd()


atlantis = Atlantis()
atlantis.run()

This short example demonstrates some of Slut's fundamental characteristics. Every Slut-based application is written around a "class" that represents the "world." Slut is inherently object-oriented. Objects are described (its aesthetics, behavior, etc.) in classes and put in action in the "world." Shapes are drawn by using direct OpenGL calls. Knowledge of the OpenGL API is conveniently applicable to Slut and knowledge gained from using Slut is conveniently applicable to other software endeavors. Alternatively, one can use Slut's high level shape function to get off the ground fast.

Fundamental to Slut's core design is the ability to directly use the underlying libraries along with Slut's higher level concepts. This means that you always have the option to implement a feature yourself without changing code in the framework. This characteristic of Slut also means that its features increase automatically as the underlying libraries get updated. Slut aims to reduce complexity while still being very transparent.

A Strategy for Total Domination of ...

Knowing Slut means knowing Python, pyOpenGL, pyGame, Twisted and Slut itself. Python is the language. OpenGL is used to draw shapes. PyGame handles sound and the integration with the operating system. And Twisted does networking. While knowing all of these libraries is helpful their mastering is by no means necessary. There is a whole world of pleasure out there that can be entered by playing with the example code:

::> EXAMPLE CODE

When in doubt about Slut's API, its capabilities, its relation to the underlying libraries, or if you are the type of person who first needs to know as much as possible before applying it then you should probably spend some time with Slut's reference:

::> REFERENCE

For everything else there is Slut's mailing list. It is currently the main place for asking questions, exchanging lovely code snippets and coordinating further development:

SLUT MAILING LIST
EXAMPLE CODE

A growing collection of examples that demonstrate many aspects of Slut. Most methods and classes on the example code pages are linked to the reference manual.



REFERENCE

A reference of Slut's programming interface. Almost complete and on its best way to fully document Slut.



Initiated by Stefan Hechenberger
Thanks to CADRE's 103