Author Topic: Programming Fun  (Read 5091 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Programming Fun
« on: March 02, 2013, 04:05:57 AM »
Deleted
« Last Edit: April 14, 2015, 03:47:23 AM by Peter »

JRS

  • Guest
Re: Programming Fun
« Reply #1 on: March 02, 2013, 09:15:49 AM »
Peter,

This is your second warning. If you do not provide source with your SDL wrapper I will ask Charles to remove all your posts that violate the GNU license and file a complaint. This is one thing I take very seriously as it's the foundation of open source and it's success.

John
« Last Edit: March 02, 2013, 09:23:13 AM by JRS »

Charles Pegge

  • Guest
Re: Programming Fun
« Reply #2 on: March 02, 2013, 09:35:06 AM »
It's ok John, Peter's code does not contain SDL, though I miss seeing Peter's lib source code. I love its elegant simplicity and there is so much one can learn by sharing expertise.

JRS

  • Guest
Re: Programming Fun
« Reply #3 on: March 02, 2013, 10:07:13 AM »
That will save you court costs. Using open source software in a closed project is just like stealing. It doesn't matter if you're trying to make a buck off it or not. If developing graphic libraries is your passion then purchase a commercial package that allows you royalty free use or purchase a commercial license to SDL.

I don't think it's fair to jeopardize the OxygenBasic open source project or my contributions of facilitating the project by hosting illegal software. There are plenty of file sharing networks to distribute bootleg software so maybe that is a better venue for your efforts.  
« Last Edit: March 02, 2013, 10:23:55 AM by JRS »

Aurel

  • Guest
Re: Programming Fun
« Reply #4 on: March 02, 2013, 11:54:58 AM »
Come one John ,why such a reaction ?
Peter provide many many times whole set of functions for GDI graphics and some other stuff.
From your point of view if something is in dll is contra open-source .
I think that this is simple over-reaction from you .

JRS

  • Guest
Re: Programming Fun
« Reply #5 on: March 02, 2013, 12:36:31 PM »
I have had my site shutdown by a user of a forum I had many years ago when he claimed (and filed) copyright violation when I wouldn't remove his posts.

Where would the open source community be today if everyone just looked the other way when software licensees are being violated?

The real question is why has Peter taken the stand he has and refusing to release source knowing before writing a single line of code that his work is based on open source efforts of people that came before him. Do we need to gather donations to buy Peter a license to a graphics package so he can keep Simple Windows to himself?

I manage a open source project LGPL that allows free use (open source or commercial) and promote the project in that way. Projects come with a license to use and we must respect the contributors wishes.

Quote
Licensing the Simple DirectMedia Layer library

    SDL 1.2 and older are available under the GNU LGPL license .

    SDL 2.0 and newer are available under the zlib license .


 This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

It seems you are free to use SDL in any way you wish.

Please ignore my license warnings for the SDL package but I take back nothing when it comes to violating open source licensing.

« Last Edit: March 02, 2013, 12:54:17 PM by JRS »

Charles Pegge

  • Guest
Re: Programming Fun
« Reply #6 on: March 02, 2013, 02:59:45 PM »

Ice? Nooo! On the contrary, I drink Gunpowder tea  ;D

I they knew what it does to me, they would ban it!



JRS

  • Guest
Re: Programming Fun
« Reply #7 on: March 02, 2013, 03:14:50 PM »
I finally understand what the T_ means in C programming.  :D

JRS

  • Guest
Re: Programming Fun
« Reply #8 on: March 02, 2013, 05:37:58 PM »
Peter,

Do you have a test program for this latest release?

John

JRS

  • Guest
Re: Programming Fun
« Reply #9 on: March 02, 2013, 06:02:10 PM »
It wasn't included within the zip is the reason I asked.

The SDL library is coming along nicely based and what you have shared.

Thanks for updating your post with the test code.

Who is Peter Pan?
Quote
Peter is mainly an exaggerated stereotype of a boastful and careless boy. He is quick to point out how great he is, even when such claims are questionable. Peter has a nonchalant, devil-may-care attitude, and is fearlessly cocky when it comes to putting himself in danger. Peter can also be quite selfish and arrogant. Peter either symbolizes or personifies the selfishness of childhood through constant forgetfulness and self-centered behavior. Peter appears very judgmental and pompous, nonetheless, he has a strong sense of justice and is always quick to assist those in danger.

To live will be an awfully big adventure.

X
« Last Edit: March 03, 2013, 10:00:40 PM by JRS »

JRS

  • Guest
Re: Programming Fun
« Reply #10 on: March 03, 2013, 11:13:51 PM »
Being able to fly and never grow old are also positive attributes.  ;)
« Last Edit: March 03, 2013, 11:19:38 PM by JRS »

Charles Pegge

  • Guest
Re: Programming Fun
« Reply #11 on: March 04, 2013, 10:02:15 PM »
Hi Peter,

2 ways: (our arrays are not implicitly pointered like c)

sys *keystate
&keystate = SDL_GetKeyState(null)
if keystate[SDLK_TAB] then print "TAB was pressed"



sys keystate at (SDL_GetKeyState(null))
if keystate[SDLK_TAB] then print "TAB was pressed"




Charles Pegge

  • Guest
Re: Programming Fun
« Reply #12 on: March 04, 2013, 10:46:01 PM »
Enumerations:

You can use enumeration literals by providing an enumeration tag word then using dotted keywords


typedef enum tag_alphabet
{
 a=1,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
} alphabet

print tag_alphabet.d 'result: 4

I will try to improve this situation by making it work with alpahabet

Charles
« Last Edit: March 04, 2013, 10:53:41 PM by Charles Pegge »

JRS

  • Guest
Re: Programming Fun
« Reply #13 on: March 05, 2013, 12:43:19 AM »
Here is a Linux SDL example in Vala



Code: [Select]
using SDL;
using SDLGraphics;

public class SDLSample : Object {

    private const int SCREEN_WIDTH = 640;
    private const int SCREEN_HEIGHT = 480;
    private const int SCREEN_BPP = 32;
    private const int DELAY = 10;

    private unowned SDL.Screen screen;
    private GLib.Rand rand;
    private bool done;

    public SDLSample () {
        this.rand = new GLib.Rand ();
    }

    public void run () {
        init_video ();

        while (!done) {
            draw ();
            process_events ();
            SDL.Timer.delay (DELAY);
        }
    }

    private void init_video () {
        uint32 video_flags = SurfaceFlag.DOUBLEBUF
                           | SurfaceFlag.HWACCEL
                           | SurfaceFlag.HWSURFACE;

        this.screen = Screen.set_video_mode (SCREEN_WIDTH, SCREEN_HEIGHT,
                                             SCREEN_BPP, video_flags);
        if (this.screen == null) {
            stderr.printf ("Could not set video mode.\n");
        }

        SDL.WindowManager.set_caption ("Vala Linux SDL Demo", "");
    }

    private void draw () {
        int16 x = (int16) rand.int_range (0, screen.w);
        int16 y = (int16) rand.int_range (0, screen.h);
        int16 radius = (int16) rand.int_range (0, 100);
        uint32 color = rand.next_int ();

        Circle.fill_color (this.screen, x, y, radius, color);
        Circle.outline_color_aa (this.screen, x, y, radius, color);

        this.screen.flip ();
    }

    private void process_events () {
        Event event;
        while (Event.poll (out event) == 1) {
            switch (event.type) {
            case EventType.QUIT:
                this.done = true;
                break;
            case EventType.KEYDOWN:
                this.on_keyboard_event (event.key);
                break;
            }
        }
    }

    private void on_keyboard_event (KeyboardEvent event) {
        if (is_alt_enter (event.keysym)) {
            WindowManager.toggle_fullscreen (screen);
        }
    }

    private static bool is_alt_enter (Key key) {
        return ((key.mod & KeyModifier.LALT)!=0)
            && (key.sym == KeySymbol.RETURN
                    || key.sym == KeySymbol.KP_ENTER);
    }

    public static int main (string[] args) {
        SDL.init (InitFlag.VIDEO);

        var sample = new SDLSample ();
        sample.run ();

        SDL.quit ();

        return 0;
    }
}

Charles Pegge

  • Guest
Re: Programming Fun
« Reply #14 on: March 05, 2013, 02:20:31 AM »
Peter, John,

I'm going to change Oxygen's enumeration system to conform to C. That is: all enumeration members behave like simple equates. This will avoid a lot of trouble, and I can throw out large hunks of code :)

Charles