Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => The "Geek" corner => Topic started by: Patrice Terrier on October 09, 2008, 10:52:50 PM

Title: Boing2
Post by: Patrice Terrier on October 09, 2008, 10:52:50 PM
Do you remember that?

To stop it, catch the ball and press ESCAPE.

...
Title: Re: Do you remember that?
Post by: Petr Schreiber on October 10, 2008, 08:17:05 AM
Amiga? :D

Worked well on WinXP SP2.


Petr
Title: Re: Do you remember that?
Post by: Patrice Terrier on October 10, 2008, 09:29:13 AM
Here is a screen shot on my computer.

(http://www.zapsolution.com/pictures/Boing.png)

Your graphic card must be full OpenGL compatible, i am using these settings for ambient light:

                  DIM LightAmbient(3) AS SINGLE:  ARRAY ASSIGN LightAmbient()  = 0.05, 0.05, 0.05, 1.0
                  DIM LightDiffuse(3) AS SINGLE:  ARRAY ASSIGN LightDiffuse()  = 1.0, 1.0, 1.0, 1.0
                  DIM LightPosition(3) AS SINGLE: ARRAY ASSIGN LightPosition() = -0.20, 0.20, 0.20, 0.7
                  CALL glLightfv(%GL_LIGHT0, %GL_AMBIENT, LightAmbient(0))      ' Setup The Ambient Light
                  CALL glLightfv(%GL_LIGHT0, %GL_DIFFUSE, LightDiffuse(0))      ' Setup The Diffuse Light
                  CALL glLightfv(%GL_LIGHT0, %GL_POSITION, LightPosition(0))    ' Position The Light
                  CALL glEnable(%GL_LIGHT0)                                     ' Enable Light ZERO
                  CALL glEnable(%GL_LIGHTING)                                   ' Enable Lighting
                  CALL glEnable(%GL_COLOR_MATERIAL)                             ' Enable Coloring Of Material


Also your display must be running in 32-bit mode and the "Boing.png" must also be in 32-bit (alpha channel).

Anyway, i have provided the source code, to let you play with the settings.

Added:
I just checked on my Compaq Presario first Dual Core generation running Windows XP SP2 and ATI Radeon X600 Series, and it works like a charm, with a 24% CPU footprint.

Note: Due to the way i am using the timer, the animation is very cooperative with other application, because it is the OS that shares the time between each process, thus the 24% CPU is just informative and you won't see any impact on your other running applications.

...
Title: Re: Do you remember that?
Post by: Emil Weiss on October 12, 2008, 12:18:36 PM
sorry i hope i can tell here ;)
can you say me what you do with this?

    FOR P = (nWidth * nHeight) TO 1 STEP - 1
           @pBits[3] = A?
           @pBits[2] = R?
           @pBits[1] = G?
           @pBits[0] = B?
           pBits = pBits + 4
    NEXT


i think pBits is a pointer of byte = PByte
no idea can translate it to Delphi
this is a array in Delphi pBits[3]

i hope anybody can help me

greets Emil
Title: Re: Do you remember that?
Post by: Patrice Terrier on October 12, 2008, 09:00:43 PM
Yes, pBits is a pointer of byte.

See also my zColorARGB API, and PowerBASIC Poke and Poke$.

I thought you were moving from Pascal to PB ;)

...

Title: Re: Do you remember that?
Post by: Emil Weiss on October 13, 2008, 04:15:27 AM
Quote from: Patrice Terrier on October 12, 2008, 09:00:43 PM
Yes, pBits is a pointer of byte.

See also my zColorARGB API, and PowerBASIC Poke and Poke$.

I thought you were moving from Pascal to PB ;)

...



Thanks Patrice..
i will show how work the Skin in Delphi :)

greets Emil
Title: Re: Do you remember that?
Post by: Patrice Terrier on October 13, 2008, 09:30:48 AM
Quotei will show how work the Skin in Delphi

My code is compatible with any 32-bit compiler and even managed languages, as long as you keep using the low level FLAT API to preserve the portability.

Title: Re: Do you remember that?
Post by: Emil Weiss on October 13, 2008, 12:32:23 PM
Quote from: Patrice Terrier on October 13, 2008, 09:30:48 AM
Quotei will show how work the Skin in Delphi

My code is compatible with any 32-bit compiler and even managed languages, as long as you keep using the low level FLAT API to preserve the portability.



yes ;)
i hard translate to Delphi.
i have tell many ofters you are a good programmer (like Genius)
that comes from hearts

greets Emil
Title: Re: Do you remember that?
Post by: Patrice Terrier on October 13, 2008, 05:13:28 PM
Here is a new texture to replace the default boing.png.
(Better to save the original in case ou don't like it).
Title: Re: Do you remember that?
Post by: Emil Weiss on October 13, 2008, 05:24:06 PM
Quote from: Patrice Terrier on October 13, 2008, 05:13:28 PM
Here is a new texture to replace the default boing.png.
(Better to save the original in case ou don't like it).


Show better as Amiga Boing ;)

greets Emil
Title: Re: Do you remember that?
Post by: Emil Weiss on October 14, 2008, 07:36:10 PM
Quote from: Patrice Terrier on October 14, 2008, 05:32:03 PM
Here are a few new textures to replace the default boing.png.


Do you make this all self ?
Please which grafik Application your use ?

think adobe Photoshop not to good for PNG

greets Emil
Title: Re: Do you remember that?
Post by: Patrice Terrier on October 14, 2008, 08:11:42 PM
QuotePlease which grafik Application your use ?

PhotoShop...

Title: Re: Boing2
Post by: Patrice Terrier on August 09, 2011, 10:05:25 AM
The first post of this thread has been updated, to fix the ZIP file corruption caused by the "Server Collapse".

...
Title: Boing2 revival
Post by: Patrice Terrier on December 16, 2014, 10:16:18 AM
This version is a reworked version of the first post of this thread.

It has been updated to work with PB 10, and it is provided as an example of low level SDK programming producing a small resulting EXE of 27648 bytes.

Note: press the escape key to shut it down.

...
Title: Re: Boing2
Post by: Patrice Terrier on April 25, 2017, 07:09:42 PM
Here is a reworked version of the C++ 64-bit, showing the mixing of a 2D image altogether with a 3D OpenGL.
http://www.objreader.com/index.php?topic=92.0

Note: this a 19 Kb TCLib version

This code has also been posted on codeproject, but from the first rate, it seems that some people do not care anymore about small exe size  ;D
https://www.codeproject.com/Articles/1183876/Boing
Title: Re: Boing2
Post by: Stefan Midegaal on April 25, 2017, 08:32:55 PM
Quoteit seems that some people do not care anymore about small exe size

In the present time, no one is interested in whether an EXE is small or large
Of course, there are exceptions.
Title: Re: Boing2
Post by: Patrice Terrier on April 25, 2017, 08:55:38 PM
QuoteOf course, there are exceptions.
It is like SDK coders... we are endangered species.

When i started programming i never thought that one day, the Dinosaurus time would come back.
While being 68, i am still slim, but perhaps because i never eat fast food.  :-X

Title: Re: Boing2
Post by: Stefan Midegaal on April 25, 2017, 10:25:37 PM
Quotebut perhaps because i never eat fast food
I know many people who are slim
That says nothing about whether I eat Fastfood

i understand what your mean.
But they create enemies.. read the article on codeproject

In this time have much forgotten the word THANK YOU
That should be clear to them.
in this sense :) And do not forget it's another century
Title: Re: Boing2
Post by: Patrice Terrier on April 26, 2017, 10:01:21 AM
Emil

"Fast food" was a metaphore for the bloated code created by the new programming paradigm.

And being in a new century doesn't mean to throw out the good pratice.

By the way i have removed the offending code from codeproject ;)

...
Title: Re: Boing2
Post by: Stefan Midegaal on April 26, 2017, 10:30:43 AM
Quote"Fast food" was a metaphore for the bloated code created by the new programming paradigm.
that is why i have written
Quotei understand what your mean.
QuoteAnd being in a new century doesn't mean to throw out the good pratice.
Dito!
QuoteBy the way i have removed the offending code from codeproject
Yes
Some people are simply not worth it
Which is shared with them.
I know that.

But Boing64 works on W7 without any trouble