Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: DSFML and D1  (Read 6619 times)

0 Members and 1 Guest are viewing this topic.

bioinfornatics

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • http://blog.fedora-fr.org/bioinfornatics/
DSFML and D1
« on: November 12, 2010, 12:04:40 am »
please trass3r can you put D1 in sfml2? you can use version keyword see: http://www.digitalmars.com/d/2.0/version.html

thanks

bioinfornatics

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
    • http://blog.fedora-fr.org/bioinfornatics/
DSFML and D1
« Reply #1 on: December 08, 2010, 09:19:22 am »
Example of use
Code: [Select]
// D import file generated from 'derelict/util/compat.d'
module derelict.util.compat;
version (D_Version2){
    mixin("alias const(char)* CCPTR;");
    mixin("alias const(wchar)* CWCPTR;");
    mixin("alias const(dchar)* CDCPTR;");
    mixin("alias const(ubyte)* CUBPTR;");
    mixin("alias const(void)* CVPTR;");
    mixin("alias immutable(char)* ICPTR;");
}
else{
    alias char* CCPTR;
    alias wchar* CWCPTR;
    alias dchar* CDCPTR;
    alias ubyte* CUBPTR;
    alias void* CVPTR;
    alias char* ICPTR;
}
version (Tango){
    private
    {
        import tango.stdc.string;
        import tango.stdc.stringz;
        import tango.text.Util;
        import tango.core.Version;
    }
    version (PhobosCompatibility){
    }
    else{
        alias char[] string;
        alias wchar[] wstring;
        alias dchar[] dstring;
    }
}
else{
    private {
        version (D_Version2){
            import std.conv;
        }
        import std.string;
        import std.c.string;
    }
}
template gsharedString(){
    version (D_Version2){
        const gsharedString = "__gshared: ";
    }
    else{
        const gsharedString = "";
    }
}