Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: lainz on January 03, 2017, 03:24:09 pm

Title: Graphics Contest 2017, please vote now!
Post by: lainz on January 03, 2017, 03:24:09 pm
Welcome to the Graphics Contest 2017!

It's time to vote!

Official contest 2017 repository:
https://github.com/lazarusccr/GraphicsContest

Download 2017 binaries:
https://github.com/lazarusccr/GraphicsContest/releases/tag/2017

This is the third graphics contest we do in the Lazarus forum.

The main idea is to share the creations with other users of the forum and mantain a repository of open source code with all participations.

Categories you can participate are (not limited to, it means you can invent something out of the ordinary too):
- UI Design
- Animation
- Game design
- Photo manipulation
- Anything you can do with graphics!

Libraries that can be used:
- You can use any graphics related library or unit that works with FPC / Lazarus, check the wiki for a list (not limited to this list): http://wiki.lazarus.freepascal.org/Developing_with_Graphics#Libraries

Deadline
Previous years the deadline was too short, you know excepting the students (that doesn't work) and retired, most people here spent their time working. Another thing of consideration if that vacation/recess are different time in each part of the world, so maybe you're free now as me but alongside the year you're not, and inverse in other places.

Update: The deadline is over, now you can vote until September 1.

Previous years winners:
2015: aradeonas
2016: Michl

Previous years contests:
2015 Contest: http://forum.lazarus.freepascal.org/index.php/topic,29038.0.html
2016 Contest: http://forum.lazarus.freepascal.org/index.php/topic,32626.0.html

Previous years repository:
https://github.com/bgrabitmap/bgracontest (source code)
https://github.com/bgrabitmap/bgracontest/releases (binaries)

In that repository you will find the 2015, 2016 participations source code and binaries.
Title: Re: Graphics Contest 2017
Post by: Handoko on January 03, 2017, 06:06:33 pm
I'm in. I wanted to participate in contest 2016, but I can't because I was busy. Now, I won't pass this chance.
Title: Re: Graphics Contest 2017
Post by: DiCri on January 03, 2017, 06:14:36 pm
I'm in!
Title: Re: Graphics Contest 2017
Post by: DiCri on January 03, 2017, 06:21:28 pm
Can i use SDL2 for this graphics contest?
Title: Re: Graphics Contest 2017
Post by: lainz on January 03, 2017, 06:34:01 pm
Can i use SDL2 for this graphics contest?

Yes! Sure.

I'm in. I wanted to participate in contest 2016, but I can't because I was busy. Now, I won't pass this chance.

Thanks for joining!

I'm in!

Yeah!
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on January 04, 2017, 12:45:33 pm
Me wants.  I'll not rest until you all wipe out SDL from your HD and use Allegro.  >:D
Title: Re: Graphics Contest 2017
Post by: lainz on January 04, 2017, 02:22:58 pm
Me wants.  I'll not rest until you all wipe out SDL from your HD and use Allegro.  >:D

There's a great game made with Allegro I used to create levels and graphics for it, Open Sonic http://opensnc.sourceforge.net/home/index.php (it's made in C).

Well the winner will tell the others wich library to use  ::) I will not win (again) xD
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on January 05, 2017, 02:04:53 pm
Me wants.  I'll not rest until you all wipe out SDL from your HD and use Allegro.  >:D

There's a great game made with Allegro I used to create levels and graphics for it, Open Sonic http://opensnc.sourceforge.net/home/index.php (it's made in C).

Well the winner will tell the others wich library to use  ::) I will not win (again) xD
Didn't know about that game.  And has a lot of cool stuff.  I'll download it and see what I can sole... learn!  I've said learn.  :-[
Title: Re: Graphics Contest 2017
Post by: lainz on January 06, 2017, 09:40:42 pm
Can i use SDL2 for this graphics contest?

You can use SDL2. You can port your C++ game to Pascal (convert the code using a converter or by hand). But you can't use C++ because this contest is about pascal programming.
Title: Re: Graphics Contest 2017
Post by: lainz on January 16, 2017, 04:44:41 am
This is my first project for the contest: movingdots

It's like rain, but contains slow and fast moving dots.

Attached source code and picture.
Title: Re: Graphics Contest 2017
Post by: circular on January 16, 2017, 12:35:25 pm
Cool.  :)

Ok so we would have one year to produce our masterpiece. What about finishing the context at the end of the summer as previous times ? Last time we had less time because we started the context in the summer, but if the context starts now, that's still a lot of time left. What do you think ?
Title: Re: Graphics Contest 2017
Post by: lainz on January 16, 2017, 04:57:36 pm
Well it's summer here :) That depends where it's summer. I think you say in the north hemisphere.

For me it's fine, since I already have my project done. And there are three more people interested right now ñuño, handoko and dicri. Let's see if they are right and it's done.
Title: Re: Graphics Contest 2017
Post by: Handoko on January 16, 2017, 06:10:30 pm
I'm still looking for the idea for this contest. So please be patient.

I was writing my OpenGL graphics/game engine, which I wanted to make it compilable to Android some months ago. Unfortunately I got a lot of troubles due to my lack of knowledge about OpenGL ES which has huge differences compare to the OpenGL I ever knew. Android can use OpenGL ES but not the common OpenGL.

So my OpenGL graphics/game engine should not be submitted for this contest, it's not finished yet. I'm thinking to pull some parts out to be used for this contest. I have not decided, should I write a tool or animation.

On the beginning, I thought to use BGRABitmap, a good project that I should support. My first attempt of the installation on my Linux computer was failed. A week ago, I managed to installed it on my desktop PC, but failed on my laptop. So, now I am still looking for the graphics library to be used.

Projects submitted in previous contest were awesome. Also DiCri, now no longer a newbie. I saw his last game written in C++ + SDL recently, it's hard to believe he improved so fast. Because the participants all have great thing to show, so I should too.
Title: Re: Graphics Contest 2017
Post by: lainz on January 16, 2017, 07:07:24 pm
I forget, you can upload as many projects you want. Maybe you want to start with any of the projects you have in mind.
Title: Re: Graphics Contest 2017
Post by: Michl on January 16, 2017, 09:49:16 pm
Ah interesting, the contest is back. I missed that topic. I'll try to do something, if I find the time.

I'll make a hint in the German Lazarusforum. Is the end of summer (for me, end of summer is end of august ;)) the new date or 31 December 2017?
Title: Re: Graphics Contest 2017
Post by: lainz on January 16, 2017, 11:33:31 pm
Ah interesting, the contest is back. I missed that topic. I'll try to do something, if I find the time.

I'll make a hint in the German Lazarusforum. Is the end of summer (for me, end of summer is end of august ;)) the new date or 31 December 2017?

Thanks for posting it. Put that is not yet defined, I don't know exactly what date circular was thinking about.
Title: Re: Graphics Contest 2017
Post by: circular on January 17, 2017, 01:01:43 pm
Well it's summer here :) That depends where it's summer. I think you say in the north hemisphere.
Indeed. How to express it, hmmm, what about ending the context at the september equinox ?
Title: Re: Graphics Contest 2017
Post by: lainz on January 17, 2017, 03:18:42 pm
OK let's do it. Say that it ends on 1 September and the vote is up to 21 September.
Title: Re: Graphics Contest 2017
Post by: bylaardt on January 18, 2017, 05:58:30 am
So, here's my first test with bgra.
Can it be a start for this contest?

Title: Relogio
Category: Anything you can do with graphics!
Libraries:BGRABitmap

Tested on linux64 and linux32.
Title: Re: Graphics Contest 2017
Post by: Handoko on January 18, 2017, 07:14:14 am
The Tic-tac clock is a good start, with some improvements it can be great. It's now already configurable, you may consider to make some backgrounds and preconfigured styles, perhaps: futuristic, minimalist, classic, kid, funky.
Title: Re: Graphics Contest 2017
Post by: bylaardt on January 18, 2017, 01:52:58 pm
you may consider to make some backgrounds and preconfigured styles, perhaps: futuristic, minimalist, classic, kid, funky.
Be my guest to freely change it.
Title: Re: Graphics Contest 2017
Post by: lainz on January 18, 2017, 02:05:03 pm
Good job! Added to the contest repository. Tested on Windows 10 and works fine.
Title: Re: Graphics Contest 2017
Post by: Eugene Loza on January 18, 2017, 02:59:39 pm
Can a FOSS project ongoing for some time already participate? :)
Title: Re: Graphics Contest 2017
Post by: lainz on January 18, 2017, 03:30:11 pm
Can a FOSS project ongoing for some time already participate? :)

Yes, it's ok.
Title: Re: Graphics Contest 2017
Post by: Roland57 on January 18, 2017, 06:50:40 pm
Title: Relogio
Category: Anything you can do with graphics!
Libraries:BGRABitmap

Very nice clock! Tested under Windows 10.  :)

What is the difference between "Catholic" and "Roman" styles?
Title: Re: Graphics Contest 2017
Post by: bylaardt on January 18, 2017, 07:16:23 pm
Traditional clocks use IIII instead of IV,
Because IV is Abbreviation for latin "IVUPITER"
Catholic is latin too, but IV is just 4.
Title: Re: Graphics Contest 2017
Post by: Handoko on January 27, 2017, 12:14:23 pm
What will happen after this contest? Will the codes still openly available for others to study? I think it will be good if we have a wiki section that contains tutorials and ready-to-run source codes for graphics and games.

For this contest, I have decided to use Allegro.pas. Some years ago when I was looking for a good graphics engine, I found Allegro.pas. Unfortunately, the limited tutorials caused me not to try it. Today, I made an attempt to try it. The process didn't run too smoothly, but at least it's working now, I opened some of the examples and they run correctly.

This contest to me is a learning process of using Allegro.pas. I will record my progress of writing a very simple game using Allegro and write a tutorial later, hopefully it can be useful for others.

Allegro.pas and BGRABitmap are both great graphics library. I choose Allegro because its currently lack of tutorials.

----------

I'm too lazy to draw my own graphics also I'm afraid that my time is not permitted. Luckily I found a page that has a list of free resources. Here you may interested to have a look:

https://love2d.org/wiki/Free_Game_Resources
Title: Re: Graphics Contest 2017
Post by: lainz on January 27, 2017, 06:40:39 pm
Quote
What will happen after this contest? Will the codes still openly available for others to study? I think it will be good if we have a wiki section that contains tutorials and ready-to-run source codes for graphics and games.

Yes. You can see the first post I linked the binaries and also the source code of the previous years, is all available on GitHub. This years submissions are also on GitHub right now you can explore my source and the source of the clock of bylaardt.

Maybe an unique wiki will be needed to combine all the sources and explanations on how to compile them.
Title: Re: Graphics Contest 2017
Post by: User137 on January 27, 2017, 10:49:30 pm
Can we also require a screenshot of all submissions? Not everyone here should be expected to compile and run them.
Title: Re: Graphics Contest 2017
Post by: lainz on January 27, 2017, 10:58:43 pm
Can we also require a screenshot of all submissions? Not everyone here should be expected to compile and run them.

Better require a binary, since a screenshot doesn't show the animations.

I will compile all of them at the end of the contest, previous to the voting time.

Edit: BTW what is the point of not compiling the sources? For what is this contest if we not see the sources and learn something new made by others.. If a non programmer comes here well maybe that be the case but I doubt that will happen.
Title: Re: Graphics Contest 2017
Post by: User137 on January 28, 2017, 05:56:40 am
There are many kinds of binaries, win, linux, each 32 and 64bit... I'm currently on win-64 compiler. Screenshot in my opinion is very important even if it contains animations. And the original author can take a snapshot with a setup that guaranteed works.
Title: Re: Graphics Contest 2017
Post by: Handoko on January 28, 2017, 06:36:54 am
This contest is good to promo Lazarus/FPC/Pascal. For non-programmers and someone who want to learn programming or computer game creation, can see the potentials of Lazarus and FPC.

For Pascal users and other language programmers, they can study and perhaps compare Lazarus/FPC with other languages.

I searched tutorials for game programming, but almost all of them were available in C++ or other languages. We should make use of this opportunity to collect a list of Pascal graphics/game source codes and tutorials.

So in my opinion:

Requirement to join in this contest:

- The program must be compiled using Lazarus or FPC
- The program must be free
- The source code must be released

Additional but not required:

- Screenshots
- Installation/compilation instruction
- Comments in the source code so other can study easily
- Tutorial written in pdf, doc, odt, txt
- Executable binary
- Users can submit more than 1 project
Title: Re: Graphics Contest 2017
Post by: jwdietrich on January 28, 2017, 08:30:34 am
Source code is mandatory, precompiled binaries (for at least one of the major platforms) and screenshots are welcome additions.
Title: Re: Graphics Contest 2017
Post by: lainz on January 28, 2017, 01:16:57 pm
I agree will all of your suggestions.

I'm adding the screenshot of the clock 'relogio' by bylaardt that was missing. My project already had a screenshot.

Well, said that I'm waiting for your projects!
Title: Re: Graphics Contest 2017
Post by: lainz on January 28, 2017, 07:44:45 pm
Hi again, I've added a new version of my project using BGRABitmap GL.

The code is in the contest repository. Here a screenshot.

I don't know how to use blur effect in BGRABitmap GL so I didn't add it.
Title: Re: Graphics Contest 2017
Post by: Handoko on January 28, 2017, 07:56:41 pm
Wow, glad to see we can use BGRABitmap to simulate biology lifeform.

I think it would be better not to blur them. Also if you can, give them border and name it with a cool name like Staphylococcus.

https://en.wikipedia.org/wiki/Staphylococcus
Title: Re: Graphics Contest 2017
Post by: lainz on January 28, 2017, 08:00:41 pm
Wow, glad to see we can use BGRABitmap to simulate biology lifeform.

I think it would be better not to blur them. Also if you can, give them border and name it with a cool name like Staphylococcus.

https://en.wikipedia.org/wiki/Staphylococcus

Good idea, I will do.
Title: Re: Graphics Contest 2017
Post by: lainz on January 28, 2017, 10:58:55 pm
Here it is, now it's alive!

See here, too big to attach: https://i37.servimg.com/u/f37/19/53/21/62/moving10.jpg
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on January 30, 2017, 11:45:11 am
I'm pretty bussy now. :(


For this contest, I have decided to use Allegro.pas. Some years ago when I was looking for a good graphics engine, I found Allegro.pas. Unfortunately, the limited tutorials caused me not to try it. Today, I made an attempt to try it. The process didn't run too smoothly, but at least it's working now, I opened some of the examples and they run correctly.

This contest to me is a learning process of using Allegro.pas. I will record my progress of writing a very simple game using Allegro and write a tutorial later, hopefully it can be useful for others.

Allegro.pas and BGRABitmap are both great graphics library. I choose Allegro because its currently lack of tutorials.
Hurray!!!  :D
Title: Re: Graphics Contest 2017
Post by: Graeme on January 30, 2017, 11:35:21 pm
Here it is, now it's alive!
See here, too big to attach: https://i37.servimg.com/u/f37/19/53/21/62/moving10.jpg
I've stared at that image for 10 minutes.... contrary to the name, I didn't see anything move.   :P
Title: Re: Graphics Contest 2017
Post by: Graeme on January 30, 2017, 11:39:15 pm
With my new found interest in OpenGL I've decided to enter the competition as well.  :)  I believe I have a really nice idea for the competition (its a secret for now  ;) ) and it should be fun to implement too. Plus others will definitely be able to learn from it.

Just to confirm, the first post in this thread mentions the deadline as 1 September. Is that still correct?
Title: Re: Graphics Contest 2017
Post by: lainz on January 30, 2017, 11:40:44 pm
Here it is, now it's alive!
See here, too big to attach: https://i37.servimg.com/u/f37/19/53/21/62/moving10.jpg
I've stared at that image for 10 minutes.... contrary to the name, I didn't see anything move.   :P

That's what I say, I need to upload a video or the binary.

With my new found interest in OpenGL I've decided to enter the competition as well.  :)  I believe I have a really nice idea for the competition (its a secret for now  ;) ) and it should be fun to implement too. Plus others will definitely be able to learn from it.

Just to confirm, the first post in this thread mentions the deadline as 1 September. Is that still correct?

Welcome!

Yes it's correct that's the deadline.
Title: Re: Graphics Contest 2017
Post by: Thaddy on January 31, 2017, 09:41:47 am
Quote
Yes it's correct that's the deadline.
Is that GMT? UTC? Or are some people more equal than others? %) :D

Just to make sure I have still 8 full months and not be stricken by not meeting the dead-line by a couple of hours...As usual...
Title: Re: Graphics Contest 2017
Post by: lainz on January 31, 2017, 01:06:26 pm
Quote
Yes it's correct that's the deadline.
Is that GMT? UTC? Or are some people more equal than others? %) :D

Just to make sure I have still 8 full months and not be stricken by not meeting the dead-line by a couple of hours...As usual...

You can choose your timezone, the one fit your needs. If you participate even we have an special offer that you can submit it even the September 2. Special offer!
Title: Re: Graphics Contest 2017
Post by: Handoko on February 01, 2017, 07:48:58 am
Never thought using Allegro.pas is so easy. Here is the sneak peek of what I'm currently doing:

https://postimg.org/image/80qim95ml/
Title: Re: Graphics Contest 2017
Post by: lainz on February 01, 2017, 04:26:11 pm
Never thought using Allegro.pas is so easy. Here is the sneak peek of what I'm currently doing:

https://postimg.org/image/80qim95ml/

Which tool you used to make the gif? I need to do something like that for an opengl window.
Title: Re: Graphics Contest 2017
Post by: Handoko on February 01, 2017, 04:37:47 pm
It is hard to find a good screencast tool for Linux. Luckily I found Vokoscreen. It's simple but have all the things for basic usage. Also it doesn't need to install, just run the binary file.

http://linuxecke.volkoh.de/vokoscreen/vokoscreen-download.html
Title: Re: Graphics Contest 2017
Post by: Graeme on February 01, 2017, 04:37:52 pm
@Lainz:  I use a small Windows application called LICEcap v1.26. It is extremely simple (one executable). It works perfectly even under FreeBSD with WINE.

LICEcap also has a few nice features.
  - optional seconds counter in the corner of the frame
  - auto stop record after x amount of time
  - user defined recording window size
  - what framerate you want to record at
  - stores directly to a GIF (no post processing required)
  - visually display mouse clicks
  - auto-repeat the GIF or not.

Oh, and its FREE! ;)
Title: Re: Graphics Contest 2017
Post by: lainz on February 01, 2017, 05:20:15 pm
Thanks!

Here is the movingdots
https://postimg.org/image/bwvur1hx9/

Here is the movingdots-gl
https://postimg.org/image/otvnj6rcf/
Title: Re: Graphics Contest 2017
Post by: User137 on February 06, 2017, 04:53:16 pm
I'm also working on something  8)  It's going to ruin my night sleep if i can't get it to stop skipping tiles https://gyazo.com/cbcfd68724426fcc83905b1df26c55fd  But the work in progress animation is much cooler looking than a sudoku that just finishes in a flash.

I used to have a sudoku solver from before but i'm generalizing it a little bit and almost rewrote the whole thing. In the end one could just include the unit in game and have sudoku game visualized and playable in any shape he wants. Trying to make it easy to use.
Title: Re: Graphics Contest 2017
Post by: Handoko on February 06, 2017, 05:03:30 pm
It looks cool!
Title: Re: Graphics Contest 2017
Post by: lainz on February 06, 2017, 05:29:33 pm
Wow it's really good.
Title: Re: Graphics Contest 2017
Post by: Lulu on February 06, 2017, 05:54:37 pm
Hello all !

Does our project must be cross platform to participate ?
Title: Re: Graphics Contest 2017
Post by: Handoko on February 06, 2017, 06:06:42 pm
Writing a cross platform project is more difficult, so the answer is:
No, it doesn't have to be cross platform.
Title: Re: Graphics Contest 2017
Post by: lainz on February 06, 2017, 11:25:41 pm
If it's cross platform has the advantage of more people can vote your project if they can test it in their systems. If is not cross platform there's no problem at all.
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on February 14, 2017, 08:11:53 pm
I'm finishing my very own game engine.  I did it because I need an old-school game engine (not just big pixels but also a sound generator, old style physics, etc.).  It includes an old-school map editor.  Here you have a screen shot: https://pbs.twimg.com/media/C3QTBlGXAAIF_eD.jpg

Don't know if such stuff would fit in this kind of contest.  Any suggestion?
Title: Re: Graphics Contest 2017
Post by: Handoko on February 14, 2017, 08:16:08 pm
Old-school games always full of nostalgic.  :D
Does it support 32-bit color images? Or just 256 colors limited?
Title: Re: Graphics Contest 2017
Post by: circular on February 14, 2017, 09:32:29 pm
Hello Nuno!

You're engine is pretty much graphical so that's fine.

In my view, just an editor would not exactly fit the contest, however a little game (even if there is just one level) or a demo using your engine would be great. It can also be a way to show its power so that people would be interested to try it as well.
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on February 15, 2017, 01:56:33 pm
Ok.  I'll work on a little game.

Old-school games always full of nostalgic.  :D
Does it support 32-bit color images? Or just 256 colors limited?
Up to 32-bit color.  Last Allegro version doesn't support 256 color bitmaps natively, but there's a trick using shaders that allows 8bit color bitmaps.  Right now I have no idea about shaders but I should learn to add palette effects to the engine (i.e. animated water and fire) and simulated CRT output (scanlines and such).
Title: Re: Graphics Contest 2017
Post by: Graeme on February 15, 2017, 02:48:57 pm
Old-school games always full of nostalgic.  :D
Fully agree - I love them! With newer "graphics intensive" games, they just detract from the actual game-play I think. But maybe that's just me. ;)
Title: Re: Graphics Contest 2017
Post by: lainz on February 15, 2017, 11:10:54 pm
There are a lot of this kind of games on Itch.io, Indie DB, Game Jolt... even in the Android market.

I like that kind of games, I grown playing them  :)
Title: Re: Graphics Contest 2017
Post by: Lulu on March 04, 2017, 09:51:29 pm
Hello,
I'm very interested to participate in this graphics context !
Here a screenshot of my educative game, where player, with his car, must recover number corresponding to the selected multiplication table. Car can jump, left, right, accelerate and break.

It use TOpenGLControl to use opengl, BGRABitmap by Circular for image file manipulation, text creation and other good stuff, the great ZENGL particles engine by Andrey Kemka adapted to my framework, OpenAL to play music and sound ( only .wav files) and my own tile engine with its (very simple) tool 'Tile Map Editor' to edit game's tiled map.
Title: Re: Graphics Contest 2017
Post by: circular on March 05, 2017, 09:15:15 am
Lulu, this games looks fun  :)
Title: Re: Graphics Contest 2017
Post by: lainz on March 05, 2017, 08:25:13 pm
Thanks for your interest in this contest. Remember if you want to be in to release here the source of the game, doesn't need to be today but until the end date that's defined in the first post.
Title: Re: Graphics Contest 2017
Post by: Lulu on March 05, 2017, 10:54:41 pm
Ok Lainz.
The game is not finished yet, I still have to implement several stages to make it more attractive  :)

Title: Re: Graphics Contest 2017
Post by: lainz on March 11, 2017, 03:02:31 pm
6 months left, hopefully as J-G said to me maybe in August this gets filled with a lot of entries  :)
Title: Re: Graphics Contest 2017
Post by: lainz on April 19, 2017, 01:47:46 am
We're almost half the way to the end of the contest, anyone interested?

I don't want to win this year by default  ::)
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on April 19, 2017, 10:00:07 am
I'm (re)planning the Allegro.pas demonstration game, which should be also the basis for the Allegro.pas tutorial. It will take some time because I have few free time but I'll try to finish it in time.

I'll try to add some particle effects and eye candy too.
Title: Re: Graphics Contest 2017
Post by: lainz on April 19, 2017, 07:41:02 pm
That's great  :D
Title: Re: Graphics Contest 2017
Post by: bylaardt on June 05, 2017, 07:21:31 pm
Game category, pre-compiled for linux_x64 and win.

https://github.com/bylaardt/duplo6
Title: Re: Graphics Contest 2017
Post by: Thaddy on June 05, 2017, 07:37:42 pm
Probably off-topic, but I have a contender for 2018:
https://prezi.com/cs8ruhsfg41v/the-mathematics-of-astrology/

This is all because a bug report got solved and I pointed out to Bart what the implications were if not solved:
the handling of Julian Dates which you need to solve this...

I hope Bart wins... (kidding), but serious: I promise and will provide a prize: A Raspberry Pi 3 (with powersupply etc and newly ordered) or higher ....

Rules are:
- Provide a dynamic representation of the complete maths presented.
- Bonus points for the mentioned but not fully mathematically presented parts...
- flair
- coding style.... (otherwise you get a Raspberry Pi one, second hand.... I can't miss it yet..)
Title: Re: Graphics Contest 2017
Post by: lainz on June 05, 2017, 10:22:23 pm
Game category, pre-compiled for linux_x64 and win.

https://github.com/bylaardt/duplo6

Sure it wins, you have my vote. I played a variant of this game yesterday with real pieces.
Title: Re: Graphics Contest 2017
Post by: bylaardt on June 05, 2017, 10:58:55 pm
Sure it wins, you have my vote. I played a variant of this game yesterday with real pieces.
Thanks!  :-[
Better things are coming soon.
Title: Re: Graphics Contest 2017
Post by: RAW on June 06, 2017, 12:21:19 am
This is unbeatable!
I love it.. play it every night... :D

Title: Re: Graphics Contest 2017
Post by: bylaardt on June 06, 2017, 01:04:50 am
My forgotten screenshot, sorry!
Title: Re: Graphics Contest 2017
Post by: lainz on June 06, 2017, 01:48:59 am
This is unbeatable!
I love it.. play it every night... :D

I think everyone programmed that game some time.  :)

My forgotten screenshot, sorry!

Now than I see, I'm missing the colors in the numbers. Also when I launch the game I can't select the combobox. I'm running Linux 64, downloaded the whole repository.
Title: Re: Graphics Contest 2017
Post by: Thaddy on June 06, 2017, 08:49:40 am
I think everyone programmed that game some time.  :)
Yup. me too... I gave up when some guy wrote the whole game (80*25 ANSI character graphics) in 256 bytes! in 1985/1986... for an assembly language contest. Using all kind of weird tricks like indexing asm opcodes (to character rom) and self modification..
Does someone still have that 8086 code? I miss it...It was brilliant, utterly brilliant...

[edit]
The commodore 64 one was not far off in 6510 assembly at 384 bytes. I did mine for Commodore 64 in just under 1K... (looser!) but I tried. So basically now you know that, on average, I am 4 times as bad as a brilliant one...
Title: Re: Graphics Contest 2017
Post by: lainz on June 06, 2017, 03:41:48 pm
I think everyone programmed that game some time.  :)
Yup. me too... I gave up when some guy wrote the whole game (80*25 ANSI character graphics) in 256 bytes! in 1985/1986... for an assembly language contest. Using all kind of weird tricks like indexing asm opcodes (to character rom) and self modification..
Does someone still have that 8086 code? I miss it...It was brilliant, utterly brilliant...

[edit]
The commodore 64 one was not far off in 6510 assembly at 384 bytes. I did mine for Commodore 64 in just under 1K... (looser!) but I tried. So basically now you know that, on average, I am 4 times as bad as a brilliant one...

Yes there are also binary size contest that the .exe file should not be larger than "x" kb.

I don't have that kind of code, the older code I have is from 2007  ::)
Title: Re: Graphics Contest 2017
Post by: bylaardt on June 06, 2017, 07:52:10 pm
Now than I see, I'm missing the colors in the numbers. Also when I launch the game I can't select the combobox. I'm running Linux 64, downloaded the whole repository.

Fixed. Tanks for the feedback.
use popup menu to change sound, deck texture or tiles colors.

Changes committed on https://github.com/bylaardt/duplo6
Title: Re: Graphics Contest 2017
Post by: RAW on June 06, 2017, 07:58:53 pm
Quote
My forgotten screenshot...
Nice! I like games with homogeneous appearance and nice colors that don't punch you visually in the face.
Title: Re: Graphics Contest 2017
Post by: turrican on June 09, 2017, 02:32:46 pm
Hey people!

I am interested on the contest! Can I participate?
Title: Re: Graphics Contest 2017
Post by: Thaddy on June 09, 2017, 02:38:07 pm
Hey people!

I am interested on the contest! Can I participate?
Yup!
Title: Re: Graphics Contest 2017
Post by: turrican on June 09, 2017, 02:44:27 pm
Cool, I will participate with a cross-platform graphic demostration using ZenGL framework based on OpenGL and DirectX.
Title: Re: Graphics Contest 2017
Post by: Thaddy on June 09, 2017, 02:45:24 pm
I think everyone programmed that game some time.  :)
Yup. me too... I gave up when some guy wrote the whole game (80*25 ANSI character graphics) in 256 bytes! in 1985/1986... for an assembly language contest. Using all kind of weird tricks like indexing asm opcodes (to character rom) and self modification..
Does someone still have that 8086 code? I miss it...It was brilliant, utterly brilliant...

[edit]
The commodore 64 one was not far off in 6510 assembly at 384 bytes. I did mine for Commodore 64 in just under 1K... (looser!) but I tried. So basically now you know that, on average, I am 4 times as bad as a brilliant one...

Yes there are also binary size contest that the .exe file should not be larger than "x" kb.

I don't have that kind of code, the older code I have is from 2007  ::)
It's bytes, not kilo bytes... It is a lost art.... >:( :( :( :(
Title: Re: Graphics Contest 2017
Post by: turrican on June 09, 2017, 02:47:21 pm
There will binary size limitation?  :o
Title: Re: Graphics Contest 2017
Post by: bylaardt on June 09, 2017, 03:38:29 pm
No limitation of this kind of art.

PS: For the Motivational Phrases Contenst my vote is for Thaddy when {$DEFINE ThaddyGrumpyModeOn}

Sometimes everyone needs a little inspiration
Title: Re: Graphics Contest 2017
Post by: J-G on June 14, 2017, 09:47:24 pm
I have an entry ready to send but don't know precisely what is required. I assume the .LPI, .LPR, .LFM and .PAS files and maybe the .ICO but suspect that .RES and .LPS might also be needed along with the Images used.

Nor do I know how the files should be sent and to whom !

... but I'm sure Lainz will enlighten me :)
Title: Re: Graphics Contest 2017
Post by: lainz on June 14, 2017, 11:32:22 pm
I have an entry ready to send but don't know precisely what is required. I assume the .LPI, .LPR, .LFM and .PAS files and maybe the .ICO but suspect that .RES and .LPS might also be needed along with the Images used.

Nor do I know how the files should be sent and to whom !

... but I'm sure Lainz will enlighten me :)

Hi J-G, how you are?

You can upload it as a zip file in your website and put a link here, basically the people needs to download and test it.

If you're in doubt include everything, except the .bak files or backup folder (that depends on the settings, where these files are generated) and also don't include the lib folder.

Executables are welcome also, but not required.
Title: Re: Graphics Contest 2017
Post by: J-G on June 15, 2017, 04:17:19 am
Hi J-G, how are you?
In good order thanks - had a fantastic concert last Saturday and still buzzing from it :)
Quote from: lainz
You can upload it as a zip file in your website and put a link here, basically the people needs to download and test it.

If you're in doubt include everything, except the .bak files or backup folder (that depends on the settings, where these files are generated) and also don't include the lib folder.

Executables are welcome also, but not required.

Since posting, I've seen fit to do some small 'tweeks' - totally cosmetic but I know that they improve the program  -  so I'll upload to my site tomorrow sometime - just need to sleep on the adjustments to determine that they really are necessary and they are done in the most efficient way (they are to do with enabling or prohibiting mouse-cursor changes to indicate available events).
Title: Re: Graphics Contest 2017
Post by: J-G on June 15, 2017, 01:07:50 pm
My entry for the 'Animation' section is now available for you to download from www.crescentcomputing.co.uk/lainz.

There is one .ZIP file - BGRA Graphics.ZIP - which contains all the Laz generated files plus Screen-shots, .PNG Images, The CorelDRAW! file and a 32bit executable.

As there are no text clues such as TButtons cluttering the main image, I've added a comment at the top of the .PAS file to explain the thinking and controls.

I hope I've remembered everything - you'll no doubt let me know otherwise :)
Title: Re: Graphics Contest 2017
Post by: turrican on June 15, 2017, 01:14:53 pm
My entry for the 'Animation' section is now available for you to download from www.crescentcomputing.co.uk/lainz.

There is one .ZIP file - BGRA Graphics.ZIP - which contains all the Laz generated files plus Screen-shots, .PNG Images, The CorelDRAW! file and a 32bit executable.

As there are no text clues such as TButtons cluttering the main image, I've added a comment at the top of the .PAS file to explain the thinking and controls.

I hope I've remembered everything - you'll no doubt let me know otherwise :)

Nice!

It's show high CPU usage on a I5-4590 @ 3'3 GHZ.
Title: Re: Graphics Contest 2017
Post by: lainz on June 16, 2017, 02:34:49 pm
Thanks for the correction :)

My entry for the 'Animation' section is now available for you to download from www.crescentcomputing.co.uk/lainz.

There is one .ZIP file - BGRA Graphics.ZIP - which contains all the Laz generated files plus Screen-shots, .PNG Images, The CorelDRAW! file and a 32bit executable.

As there are no text clues such as TButtons cluttering the main image, I've added a comment at the top of the .PAS file to explain the thinking and controls.

I hope I've remembered everything - you'll no doubt let me know otherwise :)

Amazing as always J-G! I've run the .exe under Ubuntu Linux with Wine, despite it shows a shadow around the clock (it's only on Ubuntu) it works very well.
Title: Re: Graphics Contest 2017
Post by: J-G on June 16, 2017, 02:59:20 pm
Thanks for the correction :)
Thought you might like that :)  You know I hold the opinion that if you don't correct, you accept - and that helps no-one.
Quote from: lainz
Amazing as always J-G!
I'm not sure I would apply that epithet but thanks.
Quote from: lainz
I've run the .exe under Ubuntu Linux with Wine, despite it shows a shadow around the clock (it's only on Ubuntu) it works very well.
I got a little excited at first read  -  I missed the mention of Wine :)  -  cross-compiling to native Linux and Android are aspirations.
Title: Re: Graphics Contest 2017
Post by: lainz on June 16, 2017, 03:28:19 pm
Quote
I got a little excited at first read  -  I missed the mention of Wine :)  -  cross-compiling to native Linux and Android are aspirations.
Yes, I think is not possible because your application uses Windows dll's. You must find a cross-platform way doing the same (transparency).
Title: Re: Graphics Contest 2017
Post by: circular on June 18, 2017, 07:22:03 pm
Lots of interesting projects.

I realise I am not keeping up with the contest. How much time left?
Title: Re: Graphics Contest 2017
Post by: fred on June 18, 2017, 07:38:17 pm
From page 1: "So the deadline this year is until 1 September 2017."
From Calendar Magic:
*** Days between Dates - Jun 18, 2017 and Sep 1, 2017 ***
Difference = 75 days = 2 months 14 days
Title: Re: Graphics Contest 2017
Post by: Handoko on June 18, 2017, 08:42:49 pm
I made glSlideshow - a simple slideshow using Lazarus TOpenGLControl, to show how to use OpenGL to do animations.

My knowledge about OpenGL is very limited, so far the transition effects supported are:
- Slide In
- Fade To Background
- Ribbon

Limitations:
- No support for resizing and full screen preview
- No sound effect
- Max. 5 slides
- Cannot save project
- Cannot remove slide
- Only jpeg image is supported

Hope this code can be useful for someone who wants to learn OpenGL.

--- edit ---

I forgot to mentioned, to be able to compile this code, you need to enable LazOpenGLContext on your Lazarus:
Lazarus main menu > Package > Install/Uninstall Packages > on right panel, select: LazOpenGLContext 0.0.1 > click: Install selection > Save and rebuild IDE.

I built this program using Lazarus 1.6.4 on Linux PC. For Linux users, you need to instal libgl1-mesa-dev library. The code didn't use any OS specific functions, I'm not sure but I think it should be able to compile on Windows machines too.
Title: Re: Graphics Contest 2017
Post by: lainz on June 19, 2017, 09:09:35 pm
Hi Handoko, I'm a new Linux user for a month or less, I can't rebuild lazarus when I try to install OpenGL package. Any ideas? I'm on Ubuntu.
Title: Re: Graphics Contest 2017
Post by: Eugene Loza on June 19, 2017, 09:16:56 pm
Hi Handoko, I'm a new Linux user for a month or less, I can't rebuild lazarus when I try to install OpenGL package. Any ideas? I'm on Ubuntu.
What is the problem you're experiencing? Is this "Error while linking"? If yes, get Lazarus 1.8.0RC2, debian packages are fixed there.
Title: Re: Graphics Contest 2017
Post by: lainz on June 19, 2017, 09:19:49 pm
Hi Handoko, I'm a new Linux user for a month or less, I can't rebuild lazarus when I try to install OpenGL package. Any ideas? I'm on Ubuntu.
What is the problem you're experiencing? Is this "Error while linking"? If yes, get Lazarus 1.8.0RC2, debian packages are fixed there.

Thanks I will do. Seems that also there's a library needed to be installed in the system according to this
http://forum.lazarus.freepascal.org/index.php/topic,35807.msg237482.html#msg237482

Done. That was the missing library.

@Handoko, well done! Thanks for your demo.  :)
Title: Re: Graphics Contest 2017
Post by: Eugene Loza on June 19, 2017, 09:29:29 pm
Seems that also there's a library needed to be installed in the system according to this
http://forum.lazarus.freepascal.org/index.php/topic,35807.msg237482.html#msg237482

You'll also need:
libgtkglext1
libgtkglext1-dev


Usually you'll also need (actually they're usually available in the OS already):
libpng
libpng-dev
zlib1g
zlib1g-dev


and if you need not only OpenGl:
libopenal1
libopenal-dev
libvorbis
libvorbis-dev
libfreetype6
libfreetype6-dev


and of course libgl1-mesa-dev, as Handoko mentioned.
Title: Re: Graphics Contest 2017
Post by: lainz on June 19, 2017, 11:08:18 pm
Thanks. Seems a list for a complete application with compressed images and audio, plus text support.

For the Handoko application just using libgl1-mesa-dev was enough, also I didn't change lazarus 1.6 (I will do when needed).
Title: Re: Graphics Contest 2017
Post by: LazarDan on June 23, 2017, 08:06:45 am
Hi
I believe all ready late for this graphic content , but I want to ask when will be the next one. I'm graphic designer and looking for contests like this. Can you please let me know?
 
Title: Re: Graphics Contest 2017
Post by: Handoko on June 23, 2017, 08:54:14 am
Hello LazarDan,
Welcome to the forum.

You still has about 2 months. If you can't finished it before the deadline, there should be similar contest again in 2018.
Title: Re: Graphics Contest 2017
Post by: lainz on June 23, 2017, 09:14:24 pm
Hi
I believe all ready late for this graphic content , but I want to ask when will be the next one. I'm graphic designer and looking for contests like this. Can you please let me know?

Remember that's a graphics contest with programming if you don't already know it.
Title: Re: Graphics Contest 2017
Post by: lainz on June 24, 2017, 09:16:57 pm
We have a bit more than 2 months to finish this contest. Currently we have 7 projects by 5 participants (2 by lainz, 2 by bylaardt, 1 by raw, 1 by j-g, 1 by handoko).

Sources here:
https://github.com/lazarusccr/GraphicsContest
Title: Re: Graphics Contest 2017
Post by: bylaardt on June 25, 2017, 07:24:29 am
The Tic-tac clock is a good start, with some improvements it can be great. It's now already configurable, you may consider to make some backgrounds and preconfigured styles, perhaps: futuristic, minimalist, classic, kid, funky.
So here it goes!
https://github.com/bylaardt/steampunkclock (https://github.com/bylaardt/steampunkclock)
I know is a little late, sorry!

Limitations: Use PNG files.

If you want to use a selfmade layout, just pb_clock unit is needed:
Code: Pascal  [Select][+][-]
  1. with TClockBuilder.Create(self) do begin
  2.   left:=10;
  3.   top:=10;
  4.   width:=100;
  5.   height:=100;
  6.   LoadFromClockFile('My_clock_file.spcf');
  7. end;
  8.  
Title: Re: Graphics Contest 2017
Post by: lainz on June 26, 2017, 09:48:50 pm
Thanks! It's not late there's time until 1 September.

That's the multi clock machine :)
Title: Re: Graphics Contest 2017
Post by: bylaardt on June 27, 2017, 01:30:05 am
late for handoko's request  :-\
The suggestion is from january and was implemented just on the last week.
Title: Re: Graphics Contest 2017
Post by: Handoko on June 30, 2017, 05:56:38 pm
Time is running out. It still needs much things to added to make it complete game.
Title: Re: Graphics Contest 2017
Post by: lainz on July 01, 2017, 05:00:22 pm
Time is running out. It still needs much things to added to make it complete game.

Looking good.  :)
Title: Re: Graphics Contest 2017
Post by: Pascal on July 05, 2017, 08:28:35 am
I dug out my old delphi presentation tool prototype and decided to port it to fpc and build a full application out of it.
Title: Re: Graphics Contest 2017
Post by: lainz on July 06, 2017, 12:59:08 am
I dug out my old delphi presentation tool prototype and decided to port it to fpc and build a full application out of it.

Looking good. If you want to participate you must share your code as all the others did.
Title: Re: Graphics Contest 2017
Post by: Pascal on July 06, 2017, 05:45:22 am
Yes, of course. Is there a problem when it'swindows only?
Title: Re: Graphics Contest 2017
Post by: Handoko on July 06, 2017, 06:32:05 am
No problem. Windows, Linux, Mac ... cross platform or not all are okay.
Title: Furious Palladin
Post by: Handoko on July 06, 2017, 02:46:58 pm
In the midnight of your sleep you have been attacked, your teammates died unarmed. You managed to grab your sword and saved your life. You vowed to kill 100 zombies or you will never leave.

Cursed by your vow, the sky there will be forever dark. Without the bright of the sun, zombies will keep coming out.

Will you able to break the curse and continue your journey back to the palace?



Well, the game is almost finished. Animations, collision detections, etc are working well. But I need background music and some sound effects.

Any suggestion where can I get some free audio that allow us to reuse?
Title: Re: Graphics Contest 2017
Post by: lainz on July 06, 2017, 02:56:22 pm
If you want to make the sound I use Linux Multimedia Studio. I'm not a sound master, but I do small loops for my games with it. Then you should manage the volume by using audacity or another tool.
Title: Re: Graphics Contest 2017
Post by: bylaardt on July 06, 2017, 03:31:25 pm
@pascal
Write once, compile anywhere. 8-)
Freepascal is more than a delphi open source version. Note this was a delphi conversion, not a fpc/lazarus original project.
remove "windows" from "uses", use the right units and be happy with a cross-compile code. ;)
Re-do with the WOCA concept. It's time to leave these "window" limits.
I haven't got a Windows license.   :(
If I can't see your project running then I can't evaluate it.  :'(
BTW, sounds like a good job to me.
Title: Re: Graphics Contest 2017
Post by: Pascal on July 06, 2017, 03:39:16 pm
@pascal
Write once, compile anywhere. 8-)
Freepascal is more than a delphi open source version. Note this was a delphi conversion, not a fpc/lazarus original project.
remove "windows" from "uses", use the right units and be happy with a cross-compile code. ;)
Re-do with the WOCA concept. It's time to leave these "window" limits.
I haven't got a Windows license.   :(
If I can't see your project running then I can't evaluate it.  :'(
BTW, sounds like a good job to me.
Yes, i am on the way to it  8-)
Just build a patch to make TOpenGLControl renderable by a thread https://bugs.freepascal.org/view.php?id=32116 (https://bugs.freepascal.org/view.php?id=32116).
Next is:
High performance counter
and Texture loading
Title: Re: Graphics Contest 2017
Post by: lainz on July 06, 2017, 03:41:21 pm
@pascal
Write once, compile anywhere. 8-)
Freepascal is more than a delphi open source version. Note this was a delphi conversion, not a fpc/lazarus original project.
remove "windows" from "uses", use the right units and be happy with a cross-compile code. ;)
Re-do with the WOCA concept. It's time to leave these "window" limits.
I haven't got a Windows license.   :(
If I can't see your project running then I can't evaluate it.  :'(
BTW, sounds like a good job to me.

Just try wine, all OpenGL stuff like Unity Games compiled for Windows working really well, also DirectX 9.
Title: Re: Graphics Contest 2017
Post by: bylaardt on July 06, 2017, 05:10:30 pm
It's ok. It is the choice of a programmer. My opinion and yours may be divergent, but I will respect the effort to find some good reasons to support their or my when pertinent.
What would be of the evolution of science without the dialectic?

about wine:
So many security issues than i realy prefeer removing windows unit to adapt.
wine sounds like a WOP (Workaround Oriented Programming) tool.

Can i recommend install wine?
when i have a .exe and i cannot adapt/recompile it. just in this case!
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on July 06, 2017, 09:27:05 pm
In the midnight of your sleep you have been attacked, your teammates died unarmed. You managed to grab your sword and saved your life. You vowed to kill 100 zombies or you will never leave.

Cursed by your vow, the sky there will be forever dark. Without the bright of the sun, zombies will keep coming out.

Will you able to break the curse and continue your journey back to the palace?

It looks gorgueous.  I want to see it running. And the sources too. ;)

Well, the game is almost finished. Animations, collision detections, etc are working well. But I need background music and some sound effects.

Any suggestion where can I get some free audio that allow us to reuse?
Didn't you know about http://opengameart.org/ ?
Title: Re: Graphics Contest 2017
Post by: Handoko on July 09, 2017, 08:32:02 pm
Hello all.
I need helps.

The Furious Paladin is basically finished. But it failed to run on my Win32 using Wine. My tests on Linux, everything seemed to work correctly.

Can you please download and test the binaries (Win32 and Linux64)? And let me know if there is something not working correctly. Criticism and suggestions are welcome.

I will provide the source code and tutorials, but not now. I need to make the code more readable before I publicize it.

The binaries, source code and tutorial later will be able to download from Allegro.pas website. But for now, you can grab the demo from:

http://graphicslearning.com/furious-paladin-tutorials/ (http://graphicslearning.com/furious-paladin-tutorials/)

To download, you need password: lazarus.

---edit---
This is my first time using Allegro.pas, I'm still not very sure how to correctly deploy the binaries. If you are asked to provide the allegro library, I you can try to download it from:
http://liballeg.org/download.html (http://liballeg.org/download.html)
Title: Re: Graphics Contest 2017
Post by: lainz on July 10, 2017, 01:08:17 am
@handoko, the game runs too fast under Windows. I can't play I get killed instantly.
Title: Re: Graphics Contest 2017
Post by: Handoko on July 10, 2017, 04:02:34 am
Thanks for informing me, I will check it.

For testing purpose, I have added some cheat codes:
/debug            -> show bounding box of the collision test
/fastrecover    -> fast health recovery
/stoneskin       -> less damage from enemies

To use that cheat codes, put it as the command parameters.
Title: Re: Graphics Contest 2017
Post by: molly on July 10, 2017, 04:22:16 am
@Handoko
Not knowing about allegro or your ocde, i've come across this (https://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Timers) example, which should be able to time your update frequency.
Title: Re: Graphics Contest 2017
Post by: Handoko on July 10, 2017, 04:46:34 am
Okay, thank. I will add it to the code.
Title: Re: Graphics Contest 2017
Post by: Handoko on July 10, 2017, 11:23:19 am
I have added the timer, it now should run at the same speed on different machines. On my Linux computer, it seems to run at fixed 60 fps by default even I don't use timer and it won't able to go above it. If I set it 50 fps, I can see it runs slower, but if I set 70 or even 250, the results are the same as 60 fps.

On my system, I have liballegro5.2 and liballegro5-dev installed. That's why I have no problem compiling and running it. Not sure it is static or dynamic linked to the libraries. I found no explanation about it on Allegro.pas website. Also I don't know how to cross compile using Linux64 to produce Win32 binaries? Googling the web, the results are the complicated toolchains that I can't understand. %)

Please share some info how to build Allegro.pas games using Linux64 to produce Win32 binaries. Also, please test my demo, is it working properly or not?
http://graphicslearning.com/furious-paladin-tutorials/
Title: Re: Graphics Contest 2017
Post by: molly on July 10, 2017, 11:33:48 am
I have added the timer, it now should run at the same speed on different machines. On my Linux computer, it seems to run at fixed 60 fps by default even I don't use timer and it won't able to go above it. If I set it 50 fps, I can see it runs slower, but if I set 70 or even 250, the results are the same as 60 fps.
the only reason i can think of atm is vsync/screen-mode refresh rate . Do you happen to use vsync inside your code somewhere ?

Also note that other routines could wait for vsync, flip_display() for instance (docs (http://liballeg.org/a5docs/trunk/display.html#al_flip_display)):
Quote
al_flip_display
void al_flip_display(void)

Source Code

Copies or updates the front and back buffers so that what has been drawn previously on the currently selected display becomes visible on screen. Pointers to the special back buffer bitmap remain valid and retain their semantics as the back buffer, although the contents may have changed.

Several display options change how this function behaves:

  • With ALLEGRO_SINGLE_BUFFER, no flipping is done. You still have to call this function to display graphics, depending on how the used graphics system works.
  • The ALLEGRO_SWAP_METHOD option may have additional information about what kind of operation is used internally to flip the front and back buffers.
  • If ALLEGRO_VSYNC is 1, this function will force waiting for vsync. If ALLEGRO_VSYNC is 2, this function will not wait for vsync. With many drivers the vsync behavior is controlled by the user and not the application, and ALLEGRO_VSYNC will not be set; in this case al_flip_display will wait for vsync depending on the settings set in the system's graphics preferences.

See also: al_set_new_display_flags, al_set_new_display_option
Title: Re: Graphics Contest 2017
Post by: Handoko on July 10, 2017, 11:44:40 am
No, my code does not contain anything related with vsync.

This is the code for drawing:

Code: Pascal  [Select][+][-]
  1. procedure ProcessDrawing;
  2. var
  3.   C: Real;
  4.   i: Integer;
  5. begin
  6.  
  7.   case AppState of
  8.  
  9.     Intro1:
  10.       begin
  11.         al_draw_bitmap(ImgIntroPage1, 0, 0, 0);
  12.         with Player do
  13.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  14.       end;
  15.  
  16.     Intro2:
  17.       begin
  18.         al_draw_bitmap(ImgIntroPage2, 0, 0, 0);
  19.         with Player do
  20.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  21.       end;
  22.  
  23.     Playing, Paused, Lose, Win:
  24.       begin
  25.         al_clear_to_color(al_map_rgb(0, 0, 10));
  26.         // Draw health bar
  27.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgb(0, 200, 0));
  28.         C := (MaxPlayerHealth-PlayerHealth)/MaxPlayerHealth;
  29.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgba_f(C, 0, 0, C));
  30.         // Show killed information
  31.         al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 20, 4,ALLEGRO_ALIGN_LEFT,
  32.           'Killed: '+IntToStr(EnemyKilled));
  33.         // Brighten the sky
  34.         al_draw_bitmap(ImgBackground1, 0, 20, 0);
  35.         C := EnemyKilled/100;
  36.         al_draw_tinted_bitmap(ImgBackground2, al_map_rgba_f(C, C, C, C), 0, 20, 0);
  37.         // Draw player and enemies
  38.         with Player do begin
  39.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  40.           if DebugMode then begin
  41.             al_draw_rectangle(PosX+35, 230, PosX+60, 280, al_map_rgb(0, 255, 0), 1);
  42.             if (CurrentActivity = AttackL) then
  43.               al_draw_rectangle(PosX+15, 230, PosX+40, 280, al_map_rgb(255, 0, 0), 1);
  44.             if (CurrentActivity = AttackR) then
  45.               al_draw_rectangle(PosX+55, 230, PosX+80, 280, al_map_rgb(255, 0, 0), 1);
  46.           end;
  47.         end;
  48.         for i := 0 to (Enemies.Count-1) do
  49.           with TActor(Enemies[i]^) do begin
  50.             al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  51.             if DebugMode then begin
  52.               if (CurrentActivity = WalkL) or (CurrentActivity = AttackL) then
  53.                 al_draw_rectangle(PosX+30, 230, PosX+65, 280, al_map_rgb(0, 0, 255), 1);
  54.               if (CurrentActivity = WalkR) or (CurrentActivity = AttackR) then
  55.                 al_draw_rectangle(PosX+33, 230, PosX+68, 280, al_map_rgb(0, 0, 255), 1);
  56.               if (CurrentActivity = AttackL) then
  57.                 al_draw_rectangle(PosX+22, 230, PosX+47, 280, al_map_rgb(255, 0, 0), 1);
  58.               if (CurrentActivity = AttackR)  then
  59.                 al_draw_rectangle(PosX+50, 230, PosX+75, 280, al_map_rgb(255, 0, 0), 1);
  60.             end;
  61.           end;
  62.         // Show cheat info
  63.         if CheatFastRecover then
  64.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 100,ALLEGRO_ALIGN_LEFT,
  65.             'FastRecover');
  66.         if CheatStoneSkin then
  67.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 120,ALLEGRO_ALIGN_LEFT,
  68.             'StoneSkin');
  69.         // AppState related
  70.         case AppState of
  71.           Paused:
  72.             al_draw_bitmap(ImgPaused, 140, 75, 0);
  73.           Lose:
  74.             al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 250, 100,
  75.             ALLEGRO_ALIGN_CENTER, 'YOU FAILED!');
  76.           Win:
  77.             al_draw_bitmap(ImgWin, 140, 75, 0);
  78.         end;
  79.       end;
  80.  
  81.   end;
  82.  
  83.   al_flip_display;
  84.  
  85. end;

And this is the main loop:

Code: Pascal  [Select][+][-]
  1. var
  2.   Event: ALLEGRO_EVENT;
  3. begin
  4.   ProcessInit;
  5.   Start(Intro1);
  6.   while (GameIsRunning) do begin
  7.     al_wait_for_event(EventQueue, Event);
  8.     ProcessUserInput;
  9.     ProcessUpdate;
  10.     ProcessDrawing;
  11.   end;
  12.   ProcessShutdown;
  13. end.
Title: Re: Graphics Contest 2017
Post by: molly on July 10, 2017, 11:57:58 am
Thanks for the snippets, they help.

No, my code does not contain anything related with vsync.
Ah, hidden options  :)

I added to my previous post but you was quick with your response  :D

See set_new_display_option (http://liballeg.org/a5docs/trunk/display.html#al_set_new_display_option):
Quote
al_set_new_display_option
void al_set_new_display_option(int option, int value, int importance)

snip

ALLEGRO_VSYNC
Set to 1 to tell the driver to wait for vsync in al_flip_display, or to 2 to force vsync off. The default of 0 means that Allegro does not try to modify the vsync behavior so it may be on or off. Note that even in the case of 1 or 2 it is possible to override the vsync behavior in the graphics driver so you should not rely on it.

Maybe you can toy with that option a little ?
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on July 10, 2017, 02:58:12 pm
No, my code does not contain anything related with vsync.

This is the code for drawing:

Code: Pascal  [Select][+][-]
  1. procedure ProcessDrawing;
  2. var
  3.   C: Real;
  4.   i: Integer;
  5. begin
  6.  
  7.   case AppState of
  8.  
  9.     Intro1:
  10.       begin
  11.         al_draw_bitmap(ImgIntroPage1, 0, 0, 0);
  12.         with Player do
  13.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  14.       end;
  15.  
  16.     Intro2:
  17.       begin
  18.         al_draw_bitmap(ImgIntroPage2, 0, 0, 0);
  19.         with Player do
  20.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  21.       end;
  22.  
  23.     Playing, Paused, Lose, Win:
  24.       begin
  25.         al_clear_to_color(al_map_rgb(0, 0, 10));
  26.         // Draw health bar
  27.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgb(0, 200, 0));
  28.         C := (MaxPlayerHealth-PlayerHealth)/MaxPlayerHealth;
  29.         al_draw_filled_rectangle(0, 0, PlayerHealth, 20, al_map_rgba_f(C, 0, 0, C));
  30.         // Show killed information
  31.         al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 20, 4,ALLEGRO_ALIGN_LEFT,
  32.           'Killed: '+IntToStr(EnemyKilled));
  33.         // Brighten the sky
  34.         al_draw_bitmap(ImgBackground1, 0, 20, 0);
  35.         C := EnemyKilled/100;
  36.         al_draw_tinted_bitmap(ImgBackground2, al_map_rgba_f(C, C, C, C), 0, 20, 0);
  37.         // Draw player and enemies
  38.         with Player do begin
  39.           al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  40.           if DebugMode then begin
  41.             al_draw_rectangle(PosX+35, 230, PosX+60, 280, al_map_rgb(0, 255, 0), 1);
  42.             if (CurrentActivity = AttackL) then
  43.               al_draw_rectangle(PosX+15, 230, PosX+40, 280, al_map_rgb(255, 0, 0), 1);
  44.             if (CurrentActivity = AttackR) then
  45.               al_draw_rectangle(PosX+55, 230, PosX+80, 280, al_map_rgb(255, 0, 0), 1);
  46.           end;
  47.         end;
  48.         for i := 0 to (Enemies.Count-1) do
  49.           with TActor(Enemies[i]^) do begin
  50.             al_draw_bitmap(AnimImage^.Images[AnimProgress], PosX, PosY, 0);
  51.             if DebugMode then begin
  52.               if (CurrentActivity = WalkL) or (CurrentActivity = AttackL) then
  53.                 al_draw_rectangle(PosX+30, 230, PosX+65, 280, al_map_rgb(0, 0, 255), 1);
  54.               if (CurrentActivity = WalkR) or (CurrentActivity = AttackR) then
  55.                 al_draw_rectangle(PosX+33, 230, PosX+68, 280, al_map_rgb(0, 0, 255), 1);
  56.               if (CurrentActivity = AttackL) then
  57.                 al_draw_rectangle(PosX+22, 230, PosX+47, 280, al_map_rgb(255, 0, 0), 1);
  58.               if (CurrentActivity = AttackR)  then
  59.                 al_draw_rectangle(PosX+50, 230, PosX+75, 280, al_map_rgb(255, 0, 0), 1);
  60.             end;
  61.           end;
  62.         // Show cheat info
  63.         if CheatFastRecover then
  64.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 100,ALLEGRO_ALIGN_LEFT,
  65.             'FastRecover');
  66.         if CheatStoneSkin then
  67.           al_draw_text(SystemFont, al_map_rgb(255, 0, 0), 20, 120,ALLEGRO_ALIGN_LEFT,
  68.             'StoneSkin');
  69.         // AppState related
  70.         case AppState of
  71.           Paused:
  72.             al_draw_bitmap(ImgPaused, 140, 75, 0);
  73.           Lose:
  74.             al_draw_text(SystemFont, al_map_rgb(255, 255, 255), 250, 100,
  75.             ALLEGRO_ALIGN_CENTER, 'YOU FAILED!');
  76.           Win:
  77.             al_draw_bitmap(ImgWin, 140, 75, 0);
  78.         end;
  79.       end;
  80.  
  81.   end;
  82.  
  83.   al_flip_display;
  84.  
  85. end;

And this is the main loop:

Code: Pascal  [Select][+][-]
  1. var
  2.   Event: ALLEGRO_EVENT;
  3. begin
  4.   ProcessInit;
  5.   Start(Intro1);
  6.   while (GameIsRunning) do begin
  7.     al_wait_for_event(EventQueue, Event);
  8.     ProcessUserInput;
  9.     ProcessUpdate;
  10.     ProcessDrawing;
  11.   end;
  12.   ProcessShutdown;
  13. end.
I'm really curious about your sources.  Your game loop looks as the loops used in the old times, when the target system had a fixed speed (i.e: game consoles, z80 based computers, ect.).  Nowadays a single target (i.e. PC) may have different speed (not only CPU but also memory, disk and graphics hardware, that affects the final speed).  Of course, it is possible to control speed using different ways, and I'm curious to know which one you've used as I'm sure it's very different to the one I'm using in my engine.
Title: Re: Graphics Contest 2017
Post by: minesadorada on July 10, 2017, 03:07:38 pm
Can you please download and test the binaries (Win32 and Linux64)? And let me know if there is something not working correctly. Criticism and suggestions are welcome.
When running the EXE on Win 10 x64, it asks for various DLLs then quits.
allegro_image-5.2.dll
allegro_ttf-5.2.dll
allegro_font-5.2.dll
allegro-5.2.dll

HTH
Title: Re: Graphics Contest 2017
Post by: Scoops on July 10, 2017, 04:52:56 pm
@minesadorada

I also got these missing dll errors
I downloaded from https://github.com/liballeg/allegro5/releases (https://github.com/liballeg/allegro5/releases)
Version 5.2 im on Windows XP 32bit sp3 and "allegro-mingw-gcc5.3.0-x86-5.2.0.zip" contained
all the dlls needed to run the Game.
if you are 64bit try "allegro-mingw-gcc5.3.0-x64-5.2.0.zip" ?

Hope this helps
Title: Re: Graphics Contest 2017
Post by: lainz on July 10, 2017, 05:21:58 pm
For Ubuntu I downloaded the PPA containing 5.2 and the game runs fine.

For Wine I downloaded the 5.2.0 dll and put into the exe folder, then run with Wine and works fine also. If you download a newer version like 5.2.x there are more dependencies that doesn't come with Windows, something related with C++. These DLL doesn't come with the Allegro download, must be downloaded in another place.
Title: Re: Graphics Contest 2017
Post by: minesadorada on July 10, 2017, 06:28:45 pm
@minesadorada

I also got these missing dll errors
I downloaded from https://github.com/liballeg/allegro5/releases (https://github.com/liballeg/allegro5/releases)
Version 5.2 im on Windows XP 32bit sp3 and "allegro-mingw-gcc5.3.0-x86-5.2.0.zip" contained
all the dlls needed to run the Game.
if you are 64bit try "allegro-mingw-gcc5.3.0-x64-5.2.0.zip" ?

Hope this helps
For Win 10 x64 you need to download:
allegro-mingw-gcc5.3.0-x86-5.2.0.zip

and extract into the .exe folder:
allegro_acodec-5.2.dll
allegro_audio-5.2.dll
allegro_font-5.2.dll
allegro_image-5.2.dll
allegro_primitives-5.2.dll
allegro_ttf-5.2.dll
allegro-5.2.dll

The game opens OK, but with a DOS console in the background.  The game window is tiny (320x240?) on a 1920 screen, so the instruction text is practically unreadable.

I was expecting to move via left-arrow-right/arrow but no luck.

The only way to exit the game is by closing the DOS console.  There is no File/close menu in the game window. ALT+F4 didn't work.

So: to fix things for Windows..
1. Make an InnoSetup that includes the dll files
2. Make the initial screen 640 x 480 at least, with an option to enlarge
3. Include File/close in the game menu
4. Use left/right arrow keys to move - it's sort-of standard.
5. After the message "You Failed" I couldn't find an easy way to restart the game

Those are my initial comments (as invited)
Title: Re: Graphics Contest 2017
Post by: Handoko on July 10, 2017, 08:17:57 pm
Quote
ALLEGRO_VSYNC
Set to 1 to tell the driver to wait for vsync in al_flip_display, or to 2 to force vsync off. The default of 0 means that Allegro does not try to modify the vsync behavior so it may be on or off. Note that even in the case of 1 or 2 it is possible to override the vsync behavior in the graphics driver so you should not rely on it.

Maybe you can toy with that option a little ?

The speed issue now has solved, thank you. The quote you provided explains why it runs well on my computer but too fast on others. I am busy at the moment, I will inspect it deeper later, maybe some days later.

And this is the main loop:

Code: Pascal  [Select][+][-]
  1. var
  2.   Event: ALLEGRO_EVENT;
  3. begin
  4.   ProcessInit;
  5.   Start(Intro1);
  6.   while (GameIsRunning) do begin
  7.     al_wait_for_event(EventQueue, Event);
  8.     ProcessUserInput;
  9.     ProcessUpdate;
  10.     ProcessDrawing;
  11.   end;
  12.   ProcessShutdown;
  13. end.
I'm really curious about your sources.  Your game loop looks as the loops used in the old times, when the target system had a fixed speed (i.e: game consoles, z80 based computers, ect.).  Nowadays a single target (i.e. PC) may have different speed (not only CPU but also memory, disk and graphics hardware, that affects the final speed).  Of course, it is possible to control speed using different ways, and I'm curious to know which one you've used as I'm sure it's very different to the one I'm using in my engine.

The code you quoted is the revised version, which should work correctly. I heard that Allegro 5 uses event concept, which I am not familiar with. I followed the sample from the wiki page, added the Allegro timer event, and the speed issue now has solved.

@ Scoops, lainz, minesadorada

Thank you for you helps. I found no such information on the web! This information is very valuable.

@ all

I am overwhelmed by 'real' job currently, I may be able to come back maybe some days later. Please report anything that seems weird. If no new bug found, I then will start to write the tutorial.

Of course I know I am not an expert in game programming, the code may not conform to the standard. So will first let it checked by seniors before publicized to the public.

This Furious Paladin is far from complete, but it has many interesting thing inside:
- How to manage animation
- Using app state (or others called it 'game state')
- Using dynamic array (instead of TFPList)

It uses dynamic array for storing the actor data. I set a test running dynamic array vs TFPList, the result is dynamic array runs a bit faster compare to TFPList but it runs much slower when adding/deleting items. In the game, it doesn't really delete the item, it simply mark it as 'expired', so can be reuse later.

See you.
Title: Re: Graphics Contest 2017
Post by: Handoko on July 10, 2017, 08:28:42 pm
The game opens OK, but with a DOS console in the background.  The game window is tiny (320x240?) on a 1920 screen, so the instruction text is practically unreadable.

I was expecting to move via left-arrow-right/arrow but no luck.

The only way to exit the game is by closing the DOS console.  There is no File/close menu in the game window. ALT+F4 didn't work.

Sorry, I knew it. :'(

I wanted to make it stretchable on different screen sizes, but this is my first time using Allegro, I don't know how to do it properly. So to make it 'safe' on smaller screens, I decided the size is 500 x 300. I use software magnifier when running it on my 24" monitor. :o

Believe me, the game play better using shifts rather than arrows.
To back to the intro screen after losing the game, press [space].

Here is the intro1 screen:
Title: Re: Graphics Contest 2017
Post by: turrican on July 11, 2017, 12:33:37 am
Here is my little project :

https://github.com/turric4n/SimpleZGL/tree/master/examples/StarfieldShooter

Here is the binary for Windows : http://www.turric4n.com/static/StarShooter_i386-win32.zip

Simply game developed for my little daughter.

Features :

Video - Full-Screen OpenGL or DirectX 9
1% CPU usage 5% GPU
Animations
Mouse Input
Collitions
Cross-Platform and MultiOS
 






Title: Re: Graphics Contest 2017
Post by: lainz on July 11, 2017, 12:41:06 am
Here is my little project :

https://github.com/turric4n/SimpleZGL/tree/master/examples/StarfieldShooter

Here is the binary for Windows : http://www.turric4n.com/static/StarShooter_i386-win32.zip

Simply game developed for my little daughter.

Features :

Video - Full-Screen OpenGL or DirectX 9
1% CPU usage 5% GPU
Animations
Mouse Input
Collitions
Cross-Platform and MultiOS

Well done! I've played it with Wine on Ubuntu and works fine. The only thing I see is that you maybe can center the ball when you do the click, simply add an offset so when you click it is displayed centered, not from the left corner. Another thing is that there's some flickering of the balls when there are more than one at the same time, but I can't say if it's a problem with Wine or the application itself.
Title: Re: Graphics Contest 2017
Post by: Pascal on July 11, 2017, 06:29:48 am
Here is my little project :

https://github.com/turric4n/SimpleZGL/tree/master/examples/StarfieldShooter

Here is the binary for Windows : http://www.turric4n.com/static/StarShooter_i386-win32.zip

Simply game developed for my little daughter.

Features :

Video - Full-Screen OpenGL or DirectX 9
1% CPU usage 5% GPU
Animations
Mouse Input
Collitions
Cross-Platform and MultiOS

Doesn't run on Win10 Pro x64 (1703). Just Black Screen with flickering mouse pointer.
Compatibility mode doesen't help except flicking mouse pointer.
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on July 11, 2017, 10:21:29 am
For Ubuntu I downloaded the PPA containing 5.2 and the game runs fine.

For Wine I downloaded the 5.2.0 dll and put into the exe folder, then run with Wine and works fine also. If you download a newer version like 5.2.x there are more dependencies that doesn't come with Windows, something related with C++. These DLL doesn't come with the Allegro download, must be downloaded in another place.

As the Allegro.pas README file (https://sourceforge.net/p/allegro-pas/code/HEAD/tree/RELEASES/5.2.a3/README#l109) says, I recommend you to download the DLL from http://download.gna.org/allegro/allegro-bin/.  I had little problems with them.  (I'm having troubles to connect with them now)

The game opens OK, but with a DOS console in the background.  The game window is tiny (320x240?) on a 1920 screen, so the instruction text is practically unreadable.

The best solution is to use Allegro transformations (https://www.allegro.cc/manual/5/transformations.html) (linked the C documentation because the Pascal one isn't complete yet).  The idea is to create a "zoom in" transformation and apply it when rendering.  In my game engine I use this:
Code: Pascal  [Select][+][-]
  1. CONST
  2. { The screen size we want. }
  3.   S_WIDTH = 320; S_HEIGHT = 240;
  4. VAR
  5. { The transformation matrix. }
  6.   TheMatrix: ALLEGRO_TRANSFORM;
  7. { The display. }
  8.   Display: ALLEGRO_DISPLAYptr;
  9.  
  10. BEGIN
  11.   ...
  12. { After creating the display. }
  13.   al_identity_transform (TheMatrix); { To initialize. }
  14.   al_scale_transform (
  15.     fMatrix,
  16.     al_get_display_width (Display) / S_WIDTH,
  17.     al_get_display_height (Display) / S_HEIGHT
  18.   );
  19. { This will aply the matrix to the current active bitmap.  Everything draw
  20.   to such bitmap will be affected by this matrix.  Don't need to call this
  21.   each frame. }
  22.   al_use_transform (fMatrix);
  23.   ...
  24.  
The background console can be avoided compiling with the "-WG" option ("Windows GUI application").
Title: Re: Graphics Contest 2017
Post by: turrican on July 12, 2017, 03:37:59 pm
Here is my little project :

https://github.com/turric4n/SimpleZGL/tree/master/examples/StarfieldShooter

Here is the binary for Windows : http://www.turric4n.com/static/StarShooter_i386-win32.zip

Simply game developed for my little daughter.

Features :

Video - Full-Screen OpenGL or DirectX 9
1% CPU usage 5% GPU
Animations
Mouse Input
Collitions
Cross-Platform and MultiOS

Well done! I've played it with Wine on Ubuntu and works fine. The only thing I see is that you maybe can center the ball when you do the click, simply add an offset so when you click it is displayed centered, not from the left corner. Another thing is that there's some flickering of the balls when there are more than one at the same time, but I can't say if it's a problem with Wine or the application itself.

Thank you very much! I will implement the improvements that are you suggesting :)

Here is my little project :

https://github.com/turric4n/SimpleZGL/tree/master/examples/StarfieldShooter

Here is the binary for Windows : http://www.turric4n.com/static/StarShooter_i386-win32.zip

Simply game developed for my little daughter.

Features :

Video - Full-Screen OpenGL or DirectX 9
1% CPU usage 5% GPU
Animations
Mouse Input
Collitions
Cross-Platform and MultiOS

Doesn't run on Win10 Pro x64 (1703). Just Black Screen with flickering mouse pointer.
Compatibility mode doesen't help except flicking mouse pointer.

 %) Thanks for your feedback. What GPU are you using?
Title: Re: Graphics Contest 2017
Post by: turrican on July 12, 2017, 03:41:00 pm
For Ubuntu I downloaded the PPA containing 5.2 and the game runs fine.

For Wine I downloaded the 5.2.0 dll and put into the exe folder, then run with Wine and works fine also. If you download a newer version like 5.2.x there are more dependencies that doesn't come with Windows, something related with C++. These DLL doesn't come with the Allegro download, must be downloaded in another place.


I had the same problem and I solved with the correct DLL 5.2 .

Title: Re: Graphics Contest 2017
Post by: Pascal on July 12, 2017, 04:20:19 pm
%) Thanks for your feedback. What GPU are you using?
Build in Intel (i7 6700K -> HD 530)

Just tested on an other machine. With HD 4600 it works. Nice  :D
Title: Re: Graphics Contest 2017
Post by: turrican on July 12, 2017, 05:01:07 pm
%) Thanks for your feedback. What GPU are you using?
Build in Intel (i7 6700K -> HD 530)

Just tested on an other machine. With HD 4600 it works. Nice  :D

It's strange about Integrated Intel 530. I will check with my Surface PRO 3 that has an integrated graphics too. Thanks for your efforts ;)
Title: Re: Graphics Contest 2017
Post by: Pascal on July 12, 2017, 11:17:40 pm
Here you can see some progress on my presentation prog: The sizeable SlidesView:
Title: Re: Graphics Contest 2017
Post by: Ericktux on July 14, 2017, 07:08:08 am
hi my friends, this is my videogame incomplete Years ago, called "Mario cronch"  :D
I share the sources  :)

https://www.mediafire.com/?8fot8akdaazpmwo (project)
Title: Re: Graphics Contest 2017
Post by: turrican on July 14, 2017, 09:25:05 am
hi my friends, this is my videogame incomplete Years ago, called "Mario cronch"  :D
I share the sources  :)

https://www.mediafire.com/?8fot8akdaazpmwo (project)

Hi!

I saw your code and is very chaotic :)

Recomendations :

   - Avoid timers! Just one timer for the main loop. Usage more than one timer points to bad/faulty architecture design.
   - Resources are inside the PE externalize assets!
   - Canvas and GDI is very slow CPU and consumer, try to use another canvas implementation or move to an hardware accelerated backend. Ex. OpenGL.

Just my 5 cents.
Title: Re: Graphics Contest 2017
Post by: Handoko on July 18, 2017, 07:49:08 am
Some improvements have added to Furious Paladin:
- 18 July 2017  - Double sized window on large screen
- 18 July 2017  - Use ctrl keys instead of shift keys
- 10 July 2017  - Use 60 fixed fps

On Windows, the shift key detection behave differently than on Linux. So I changed it to use ctrls instead of shifts. The game does not use arrow keys for playing, because it plays better using 2 hands.

For Linux users, you need to install liballegro5.2 package. For Windows users, the needed library files are included in the download.

On double sized display mode, the images do not look good. It is understandable because it used 2x scale up. Nothing much I can do, because the size of paladin images I got are too small.

http://forum.lazarus.freepascal.org/index.php/topic,35313.msg252085.html#msg252085
Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on July 18, 2017, 09:49:18 am
I should do some testing yet but I think we have the Allegro.pas 5.2 Demonstration Game (if I have your authorization and sources to add it to the official repository, and apply the zlib/png LICENSE to it, of course).  ;) Thanks Handoko.
Title: Re: Graphics Contest 2017
Post by: User137 on July 20, 2017, 05:34:11 am
Still working on Sudoku app, but i had a very long break. This won't have much of features at all, but i think it goes well enough for a small graphical demonstration. A little more work needed before giving out source, as it doesn't yet even congratulate you on a finished game  8)  It's playable though, and some number animation is shown while the worker thread is finding a playble grid.
Title: Re: Graphics Contest 2017
Post by: Handoko on July 20, 2017, 06:18:12 am
The graphics looks good. What graphics library did it use? Is it nxPascal?
Title: Re: Graphics Contest 2017
Post by: User137 on July 20, 2017, 07:15:46 am
Yes, it's nxPascal. This should be a working source (too big to upload on forum):
https://www.dropbox.com/s/19jsdyo79ktmpmn/nxPascal_LazDemo_2017.zip?dl=0
Tested with Win10 64-bit compiling. Your Lazarus needs OpenGLContext package installed, it comes with Lazarus but not installed by default.
Title: Re: Graphics Contest 2017
Post by: Handoko on July 20, 2017, 08:23:14 am
Compile succeed but I got SIGSEGV error immediately when I run the demo. Tested on Lazarus 1.6.4 64-bit on Ubuntu Mate 16.10, it has OpenGLContext installed properly.
Title: Re: Graphics Contest 2017
Post by: User137 on July 20, 2017, 08:33:42 am
I'm not entirely sure if this is the why, but the game uses TThread in sudokuUnit.pas. Maybe this is needed in topmost uses list
Code: Pascal  [Select][+][-]
  1. {$ifdef unix}
  2.   cthreads,
  3.   cmem, // the c memory manager is on some systems much faster for multi-threading
  4. {$endif}
Title: Re: Graphics Contest 2017
Post by: turrican on July 21, 2017, 09:38:08 am
I should do some testing yet but I think we have the Allegro.pas 5.2 Demonstration Game (if I have your authorization and sources to add it to the official repository, and apply the zlib/png LICENSE to it, of course).  ;) Thanks Handoko.

I'm doing a Allegro 5.2 game example too :)
Title: Re: Graphics Contest 2017
Post by: Handoko on July 21, 2017, 10:10:19 am
I'm doing a Allegro 5.2 game example too :)

That's great. Allegro is good game library, it should get more publicity.

I'm not entirely sure if this is the why, but the game uses TThread in sudokuUnit.pas. Maybe this is needed in topmost uses list
Code: Pascal  [Select][+][-]
  1. {$ifdef unix}
  2.   cthreads,
  3.   cmem, // the c memory manager is on some systems much faster for multi-threading
  4. {$endif}

I tried your suggestion, but didn't help.

I found nxPascal many years ago. I believe it has good potential but I didn't try it because I found no tutorial. Learning a new framework without tutorial is hard, please consider to add some tutorials for beginners.
Title: Re: Graphics Contest 2017
Post by: marcov on July 21, 2017, 10:49:07 am
The graphics looks good. What graphics library did it use? Is it nxPascal?

I like the visual bit also, looks very sharp
Title: Re: Graphics Contest 2017
Post by: Thaddy on July 21, 2017, 11:24:22 am
@Marco
I suspect you mean this?
http://forum.lazarus.freepascal.org/index.php?action=dlattach;topic=35313.0;attach=19516;image

Great game!! Sometimes I win!  8)
Title: Re: Graphics Contest 2017
Post by: turrican on July 21, 2017, 11:56:23 am
I'm looking for all the examples and we have quality but not quantity. So, we need more people here!

Pascal have no limits! We need to make this contest more popular.

Title: Re: Graphics Contest 2017
Post by: Ñuño_Martínez on July 21, 2017, 06:42:26 pm
I should do some testing yet but I think we have the Allegro.pas 5.2 Demonstration Game (if I have your authorization and sources to add it to the official repository, and apply the zlib/png LICENSE to it, of course).  ;) Thanks Handoko.

I'm doing a Allegro 5.2 game example too :)
Cool, somebody else doing my work. ;D That's fine.  I can do other things then (i.e. documentation).
Title: Re: Graphics Contest 2017
Post by: User137 on July 22, 2017, 03:58:07 am
@Marco
I suspect you mean this?
http://forum.lazarus.freepascal.org/index.php?action=dlattach;topic=35313.0;attach=19516;image

Great game!! Sometimes I win!  8)
I did mention i only made it work in Win10. I don't have a Linux, and it's never been kind to me when trying to run Linux on virtual machine with hardware accelerated graphics. It said it compiled too, so i don't have any possible suggestions to give. If anyone can tell what goes wrong it would be appreciated. Either it's a threading problem with sudoku algorithm or something might be going wrong with dglOpenGL on Linux. Only you guys can tell how to fix it, private message or anything.
Title: Re: Graphics Contest 2017
Post by: lainz on July 29, 2017, 08:27:59 pm
A month and two days left, or we should start voting right now?
Title: Re: Graphics Contest 2017
Post by: balazsszekely on July 29, 2017, 08:34:22 pm
@lainz

In order to vote, we need a link, where all the projects can be downloaded at once. I'm almost certain you already have a link for us(us --> those who did not follow the thread in details, but are interested enough to vote).
Thank you!
Title: Re: Graphics Contest 2017
Post by: lainz on July 30, 2017, 02:24:55 am
@lainz

In order to vote, we need a link, where all the projects can be downloaded at once. I'm almost certain you already have a link for us(us --> those who did not follow the thread in details, but are interested enough to vote).
Thank you!

Almost done. I need to add one or two of the latest projects. Done.

Things missing:
- Handoko sources
- J-G sources: try to compile says missing png images

The link is in the first post, it's on Lazarus CCR at GitHub. And here:

https://github.com/lazarusccr/GraphicsContest

I think I need to provide the executables also like I did for previous contests.

If anyone wants to help me with binaries for all platforms: thanks :)

I've added the poll, so anyone can start voting the submitted projects from now until 1 September. That day we will know the winner.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on July 30, 2017, 05:35:34 am
I think I need to provide the executables also like I did for previous contests.
Executable avaliable For Win (.exe) and Linux(.i386 ou .x86_64) with screenshots:
https://github.com/bylaardt/duplo6
https://github.com/bylaardt/relogio
https://github.com/bylaardt/steampunkclock
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on July 30, 2017, 05:44:15 am
I have submitted and donated the source code of Furious Paladin to Nuno. I had never used Allegro.pas before, so I let him to check my code to make sure it is conform the 'standard'. The (checked/modified) code should be downloadable from Allegro.pas website. And now, I'm preparing the tutorial based on the code.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on July 30, 2017, 06:45:40 am
I'm curious about:
Sudoku (execution error describe by handoko)
Mariocronk (I can't compile it, probably missing libs. Please, can you provide a linux version?)
StarFieldShuter (same problem)

PS: It's not fair chose just one!
Why not vote by category?
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on July 30, 2017, 07:01:02 am
I managed to fix Sudoko (by User137) to make it runable on Linux:

1. Add a new procedure Start(Data: PtrInt) on Main.pas:

Code: Pascal  [Select][+][-]
  1. type
  2.  
  3.   { TForm1 }
  4.  
  5.   TForm1 = class(TForm)
  6.   //...
  7.   private
  8.   //...
  9.     procedure Start(Data: PtrInt);
  10.   //...
  11.   end;
  12.  
  13. procedure TForm1.Start(Data: PtrInt);
  14. begin
  15.   if not nx.CreateGlWindow(self) then begin
  16.     showmessage('Failed to initialize OpenGL!');
  17.   end;
  18.   FormPaint(Self);
  19. end;

2. Change opengl initialization code with QueueAsyncCall on FormCreate in Main.pas: 

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   // Initialize game window
  4.   clientHeight:=screen.Height * 3 div 5;
  5.   clientWidth:=clientHeight * 4 div 3;
  6.  
  7.   Randomize;
  8.  
  9.   // Remove these 3 lines below
  10.   //if not nx.CreateGlWindow(self) then begin
  11.   //  showmessage('Failed to initialize OpenGL!');
  12.   //end;
  13.  
  14.   // But use this
  15.     Application.QueueAsyncCall(@Start, 0);
  16. end;

3. Add -dUseCThreads to the project's custom options
Lazarus main menu > Project > Project Options > Compiler Options > Custom Options

By doing the things above, Sudoku (nxDemo2017) should be compilable on Linux, I tested it on Ubuntu Mate 64-bit.

The fix #1 and #2 are based on the advices by @Pascal and @Akira1364:
http://forum.lazarus.freepascal.org/index.php/topic,37356.msg250882.html#msg250882
Thank you Pascal and Akira ;)

I got error 211 when inspecting the code, so I found the fix #3 here:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#Lazarus_crashes_with_runtime_error_211_after_I_installed_a_component

Because I do not have account on GitHub and SourceForge, and the compressed file (657 Kb) is too big to put here, it is now temporary hosted on my blog. Someone please grab the code before I remove it. Password to download: lazarus

http://graphicslearning.com/furious-paladin-tutorials/
Title: Re: Graphics Contest 2017, please vote now!
Post by: taazz on July 30, 2017, 07:10:20 am
http://graphicslearning.com/furious-paladin-tutorials/ (http://graphicslearning.com/furious-paladin-tutorials/)
link removed.

It can stay there for a while I guess I will take down when the author tells me that he got it. After that it is up to the author to share it as he sees fit.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on July 30, 2017, 08:49:40 am
I'm curious about:
...
Mariocronk (I can't compile it, probably missing libs. Please, can you provide a linux version?)

I managed to make Mario Cronch to run on Linux but without audio:
- Disable/remove mmsystem from the uses clause in unit1.pas line #9
- Change windows to LCLType on the uses clause in unit1.pas line #9
- Disable playsound in unit1.pas line #125
- Disable playsound in unit1.pas line #133

I am not familiar with audio programming, but if someone interested to make the demo to be able to produce sound on Linux, you can try:
http://wiki.freepascal.org/Multimedia_Programming

As mentioned by the author Ericktux, the game is incomplete but I impressed that the demo did not use any (3rd party) graphics library, just TImage.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on July 30, 2017, 02:44:06 pm
thanks handoko, it works.
Both sudoku and mariocronk.
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on July 30, 2017, 03:01:02 pm
Uploaded again on my source, so you can take those others down
https://www.dropbox.com/s/19jsdyo79ktmpmn/nxPascal_LazDemo_2017.zip?dl=0

Just a minor fix, using sleep(5) instead of 30 and skipping less recursions during generation. This gives higher fps and so feels a little smoother.

Thanks Handoko too, added in credits. Both seem to be just specific to Linux things. Odd that stuff actually isn't crossplatform with out of the box settings even in Lazarus development.
Title: Re: Graphics Contest 2017
Post by: J-G on July 30, 2017, 05:36:13 pm
Things missing:
- J-G sources: try to compile says missing png images

The link is in the first post, it's on Lazarus CCR at GitHub. And here:

https://github.com/lazarusccr/GraphicsContest
I presume that I don't need to do anything then.

Quote from: lainz
I think I need to provide the executables also like I did for previous contests.
Yes - I would appreciate easy access to .EXE files - I don't have a Linux setup so cannot evaluate any entry that doesn't have a windows version.

I have looked at the three entries by bylaardt - a small comment on the dominos game, my player was holding the double 6 but that tile was played by another and when I eventually played it, it turned into a double 1 !!  -  there were a few other mis-matched tile displays as well.

Lainz - can you change the title of my entry to 'Pocket Watch' ?    -  to reflect what it actually is please.

Title: Re: Graphics Contest 2017
Post by: lainz on July 30, 2017, 06:07:14 pm
Things missing:
- J-G sources: try to compile says missing png images

The link is in the first post, it's on Lazarus CCR at GitHub. And here:

https://github.com/lazarusccr/GraphicsContest
I presume that I don't need to do anything then.

Quote from: lainz
I think I need to provide the executables also like I did for previous contests.
Yes - I would appreciate easy access to .EXE files - I don't have a Linux setup so cannot evaluate any entry that doesn't have a windows version.

I have looked at the three entries by bylaardt - a small comment on the dominos game, my player was holding the double 6 but that tile was played by another and when I eventually played it, it turned into a double 1 !!  -  there were a few other mis-matched tile displays as well.

Lainz - can you change the title of my entry to 'Pocket Watch' ?    -  to reflect what it actually is please.

Hi, the sources I uploaded says missing png images, you can check that?

And I've added a comment in the entry with that name, since I only named the entries as the project structure in the git repository, so anyone knows what source is voting.
Title: Re: Graphics Contest 2017
Post by: bylaardt on July 30, 2017, 07:20:02 pm
I have looked at the three entries by bylaardt - a small comment on the dominos game, my player was holding the double 6 but that tile was played by another and when I eventually played it, it turned into a double 1 !!  -  there were a few other mis-matched tile displays as well.

thanks for testing it on windows.
do you used the compiled version avaliable on https://github.com/bylaardt/duplo6
otherwise what version of Bgrabitmap do you had used?

My wife play every day, minimum 2 hours since i finalize it and never report to me something like that.
She wants i create a server version to play online with others real players, but now she must wating to my next summer vacation (january)

Others proposals are:
Create some variations of rules to play like spanish rules;
Personal tilles 
Personal avatars

PS: i love your bgraphics (pocket watch). it was my inspiration to make steampunkclock.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on July 30, 2017, 07:32:05 pm
@lainz
I've checked the list of .PNG files in the 'LoadImages' procedure (lines 187 - 211) against the list in the GitHub link and as it happens there are 3 files too many - ie. they are in GitHub but not actually required in my program  -  they are alternative images that I created but found I didn't need (5A, 5B & 5C). So I can't suggest a reason for the compiler complaining. I have no problem compiling.

Title: Re: Graphics Contest 2017, please vote now!
Post by: molly on July 30, 2017, 07:51:29 pm
@J-G/lainz:
are those errors originating from resourced images ?

lpi file:
Quote
13      <Resources Count="25">
14           <Resource_0 FileName="Images\01-CaseFront.png" Type="RCDATA" ResourceName="01-CASEFRONT"/>
15           <Resource_1 FileName="Images\02-MinHand.png" Type="RCDATA" ResourceName="02-MINHAND"/>
16           <Resource_2 FileName="Images\03-SecHand.png" Type="RCDATA" ResourceName="03-SECHAND"/>
17           <Resource_3 FileName="Images\04-HourHand.png" Type="RCDATA" ResourceName="04-HOURHAND"/>
18           <Resource_4 FileName="Images\05-Dial.png" Type="RCDATA" ResourceName="05-DIAL"/>
19           <Resource_5 FileName="Images\06-DayDial.png" Type="RCDATA" ResourceName="06-DAYDIAL"/>
20           <Resource_6 FileName="Images\07-DateWheel.png" Type="RCDATA" ResourceName="07-DATEWHEEL"/>
21           <Resource_7 FileName="Images\08-Winder.png" Type="RCDATA" ResourceName="08-WINDER"/>
22           <Resource_8 FileName="Images\09-Winder.png" Type="RCDATA" ResourceName="09-WINDER"/>
23           <Resource_9 FileName="Images\10-Winder.png" Type="RCDATA" ResourceName="10-WINDER"/>
24           <Resource_10 FileName="Images\11-BackRim.png" Type="RCDATA" ResourceName="11-BACKRIM"/>
25           <Resource_11 FileName="Images\12-Button.png" Type="RCDATA" ResourceName="12-BUTTON"/>
26           <Resource_12 FileName="Images\13-Back.png" Type="RCDATA" ResourceName="13-BACK"/>
27           <Resource_13 FileName="Images\14-CaseFront.png" Type="RCDATA" ResourceName="14-CASEFRONT"/>
28           <Resource_14 FileName="Images\15-TopPlates.png" Type="RCDATA" ResourceName="15-TOPPLATES"/>
29           <Resource_15 FileName="Images\18-BalWheel.png" Type="RCDATA" ResourceName="18-BALWHEEL"/>
30           <Resource_16 FileName="Images\19-BalWheel.png" Type="RCDATA" ResourceName="19-BALWHEEL"/>
31           <Resource_17 FileName="Images\20-BalPlate.png" Type="RCDATA" ResourceName="20-BALPLATE"/>
32           <Resource_18 FileName="Images\21-Wheel-3.png" Type="RCDATA" ResourceName="21-WHEEL-3"/>
33           <Resource_19 FileName="Images\22-Wheel-4.png" Type="RCDATA" ResourceName="22-WHEEL-4"/>
34           <Resource_20 FileName="Images\23-CentreWheel.png" Type="RCDATA" ResourceName="23-CENTREWHEEL"/>
35           <Resource_21 FileName="Images\24-Pallet.png" Type="RCDATA" ResourceName="24-PALLET"/>
36           <Resource_22 FileName="Images\25-Pallet.png" Type="RCDATA" ResourceName="25-PALLET"/>
37           <Resource_23 FileName="Images\26-EscapeWheel.png" Type="RCDATA" ResourceName="26-ESCAPEWHEEL"/>
38           <Resource_24 FileName="Images\27-DialBack.png" Type="RCDATA" ResourceName="27-DIALBACK"/>
39         </Resources>
Note the subdir.

edit: note the casing of the names as well btw (i haven't verified).
Title: Re: Graphics Contest 2017
Post by: J-G on July 30, 2017, 08:01:19 pm
thanks for testing it on windows.
do you used the compiled version avaliable on https://github.com/bylaardt/duplo6
Yes 
Quote from: bylaardt
otherwise what version of Bgrabitmap do you had used?
For your benefit - 9.2.1 and _Controls 431  the only version I downloaded in October 2016
Quote from: bylaardt
My wife play every day, minimum 2 hours since i finalize it and never report to me something like that.
She wants me to create a server version to play online with others real players, but now she must wait until my next summer vacation (january)

2 hours a day !!!!  -  you treat her too well  :D

I played for about 10 minutes - just to get a feel for the game. It must be at least 50 years since I played Dominoes, probably with my father and certainly before I got married (1972)
Quote from: bylaardt
Others proposals are:
Create some variations of rules to play like Spanish rules;
Personal tiles 
Personal avatars
I don't know about Spanish rules - I barely remembered that you must match the 'end' number!  A vague memory of '5s and 3s' springs to mind.
Quote from: bylaardt
PS: i love your bgraphics (pocket watch). it was my inspiration to make steampunkclock.
Thanks for the compliment - it's good to be an inspiration -  I haven't yet had time to properly evaluate the SteamPunk - though I do intend to pass that on to a friend who has a SteamPunk party every year where we all dress appropriately  :o
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on July 30, 2017, 08:25:33 pm
@J-G/lainz:
are those errors originating from resourced images ?

Note the subdir.

edit: note the casing of the names as well btw (i haven't verified).

Ah....  You may well have found the issue Molly  -  thanks.

I didn't think to mention that I keep the .PNG files in a separate folder [Images] and of course putting them into a .ZIP file doesn't reflect that. I'm sure putting the files 01- to 27- in 'images' will sort it; though the resource entries could be re-created to reflect a 'flat-file' approach as well.

I don't think the casing is of any consequence - I have gone through it with a fine tooth comb - though I do acknowledge that it might have been an issue.
Title: Re: Graphics Contest 2017, please vote now!
Post by: molly on July 30, 2017, 08:38:51 pm
Ah....  You may well have found the issue Molly  -  thanks.
No problem. common error when sharing sources with others. Lazarus is unforgivable though  :)

Quote
I'm sure putting the files 01- to 27- in 'images' will sort it;
If you make it "Images" to keep some other file-systems/OS happy, then everyone should be able to enjoy it  ;)

Quote
though the resource entries could be re-created to reflect a 'flat-file' approach as well.
You have many options. The one you choose is a simple/elegant one.

Quote
I don't think the casing is of any consequence - I have gone through it with a fine tooth comb - though I do acknowledge that it might have been an issue.
Same reason as above. Some filesystem's/OS' are case sensitive. But as said, i did not verify the names myself so might have been wrong there.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on July 30, 2017, 09:26:27 pm
2 hours a day !!!!  -  you treat her too well  :D
I played for about 10 minutes - just to get a feel for the game. It must be at least 50 years since I played Dominoes, probably with my father and certainly before I got married (1972)
I believe is just a OCD crisis

For your benefit - 9.2.1 and _Controls 431  the only version I downloaded in October 2016
Try with 9.5

I don't know about Spanish rules - I barely remembered that you must match the 'end' number!  A vague memory of '5s and 3s' springs to mind.
Just Variations of score counting on a blocked game.
Other variations increase only 1  for each hand played.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on July 30, 2017, 09:28:33 pm
Ah....  You may well have found the issue Molly  -  thanks.
No problem. common error when sharing sources with others. Lazarus is unforgiving though  :)

Quote
I'm sure putting the files 01- to 27- in 'images' will sort it;
If you make it "Images" to keep some other file-systems/OS happy, then everyone should be able to enjoy it  ;)

I'm obviously having a 'sloppy' day  :-[
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on July 31, 2017, 05:42:05 am
I noticed there was a small bug in Furious Paladin that prevent background audio to play, so I made the small fix today.

How to install:
- On Windows, just unzip the compressed file and play
- On Linux64, you need to install liballegro5.2 package

How to play:
- [left ctrl]            -> move left
- [right ctrl]          -> move right
- [left + right ctrl] -> attack
- [esc]                 -> pause/quit
- [space]             -> resume

Cheat codes (command parameter):
/debug          -> show bounding box of the collision test
/fastrecover  -> fast health recovery
/stoneskin     -> less damage from enemies

History:
- 31 July 2017, RC3 - Fix background audio issue
- 18 July 2017, RC2 - Double sized window on large screen
- 18 July 2017, RC2 - Use ctrl keys instead of shift keys
- 10 July 2017, RC1 - Use 60 fixed fps

Download binary (Linux64 and Win32 only):
http://graphicslearning.com/furious-paladin-tutorials/

Download source code:
(still waiting Nuno response)
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 01, 2017, 03:59:37 pm
No one voted? Please vote, so we can decide who is the winner :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Eugene Loza on August 01, 2017, 04:05:54 pm
No one voted? Please vote, so we can decide who is the winner :)
Do you have an compiled nominees archive? I'm afraid I won't have enough time and motivation to install all the third-party libraries at the moment :) Neither to look in each authors personal repository for a compiled version (maybe later)...

I'm afraid didn't have time to participate with a program this year due to a lot of work, I hope I'll be able to do it next year :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 01, 2017, 04:11:35 pm
No one voted? Please vote, so we can decide who is the winner :)
Do you have an compiled nominees archive? I'm afraid I won't have enough time and motivation to install all the third-party libraries at the moment :) Neither to look in each authors personal repository for a compiled version (maybe later)...

I'm afraid didn't have time to participate with a program this year due to a lot of work, I hope I'll be able to do it next year :)

I'll find the time, maybe this weekend we can start with a fresh compilation of executables.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 01, 2017, 04:38:08 pm
Hi, it was easier than I thought :D

Here are the binaries, for Windows (some include Linux also)
https://github.com/lazarusccr/GraphicsContest/releases/tag/2017

All the sources
https://github.com/lazarusccr/GraphicsContest

Notice that I've not applied the fixes posted here to fix linux compilation, because I don't have linux to test right now. So please follow any advice before compiling.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Eugene Loza on August 01, 2017, 04:43:13 pm
Here are the binaries, for Windows (some include Linux also)
https://github.com/lazarusccr/GraphicsContest/releases/tag/2017
Thanks a lot!  ;)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Zath on August 01, 2017, 04:48:47 pm
Is there somewhere I can look through the entries one by one ?
I can't vote without seeing them !

Thanks
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 01, 2017, 04:55:45 pm
Is there somewhere I can look through the entries one by one ?
I can't vote without seeing them !

Thanks

Here:
Hi, it was easier than I thought :D

Here are the binaries, for Windows (some include Linux also)
https://github.com/lazarusccr/GraphicsContest/releases/tag/2017

All the sources
https://github.com/lazarusccr/GraphicsContest

Notice that I've not applied the fixes posted here to fix linux compilation, because I don't have linux to test right now. So please follow any advice before compiling.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Zath on August 01, 2017, 05:13:40 pm
Is there somewhere I can look through the entries one by one ?
I can't vote without seeing them !

Thanks

Here:
Hi, it was easier than I thought :D

Here are the binaries, for Windows (some include Linux also)
https://github.com/lazarusccr/GraphicsContest/releases/tag/2017

All the sources
https://github.com/lazarusccr/GraphicsContest

Notice that I've not applied the fixes posted here to fix linux compilation, because I don't have linux to test right now. So please follow any advice before compiling.

Thank you.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 01, 2017, 09:46:50 pm
@lainz
"toc.wav" is missing on https://github.com/lazarusccr/GraphicsContest/releases/tag/2017.
it works but the sound experience is not complete.
Avaliable on https://github.com/bylaardt/duplo6/blob/master/toc.wav

The original images used on StemPunkClock are now avaliable on https://github.com/bylaardt/steampunkclock/tree/master/Original%20Images.
Special thanks to J-G.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Eugene Loza on August 02, 2017, 09:36:58 am
My short review of the contesting projects  :-[

ball_by_raw
Really nice joke-like idle game. I remember in 2000s' we've had a similar cheat "Do you like your salary?" and button "No" running away :)

bgragraphics_by_j-g_(pocketwatch)
Looks cool and stylish. However, I've ran into a bug, that it blinks ~1 times per second :) / Win7x64

duplo6_by_bylaardt
Looks like a very nice game, thou I can't play dominoe :) I didn't even understand the rules :)

furiouspalladin_by_handoko
Really cool fully playable game which actually has it all. Thou the controls are horrible :) I always move in the wrong direction instead of attacking enemies. My max score was 23... One more thing, I couldn't close the game GUI window, only by closing the console window I could close the game (Win7x64)

glslideshow_by_handoko
Nice slideshow program, thou definitely lacks feature to load multiple files at once. Maybe some dynamic transparency would also make a nice addition. To be useful it has also to feature loading/saving of playlists and ability to run fullscreen.

mariocronch_by_ericktux
Flappy Mario :) Anyway it looks good. I've experienced a bug that player&enemies sprites blink thou.

movingdots_by_lainz
This one looks like a very cool effect, e.g. for a game loadscreen. But it blinks for me (did you forget doublebuffer=true?) and gives an error and heapTRC on close.

movingdotsgl_by_lainz
Works flawlessly, unlike previous variant, but not as spectacularly cool :)

relogio_by_bylaardt
Nice customizable watch. But again it blinks for me... As if doublebuffer=false.

starsfieldshooter_by_turrican
Shows me just blank black fullscreen...

steampunkclock_by_bylaardt
Nice and beautiful watch (again? clocks are popular :)) But again it blinks onmouseover... what on the Earth is going on with my Windows?

sudoku_by_user137
It looks spectacular and works flawlessly for me. Thou, I'm not a good sudoku player, therefore I can't solve it without aiding stuff like "marking obvious errors" (e.g. make the number red if it doesn't fit here) or pinning suggestions (e.g. I know that 6 or 7 may be in this cell, but I'm not yet sure which one exactly). Also a difficulty level would be more than welcome :) I wish there was an animation effect (like waving) of the whole field :)

I personally liked sudoku_by_user137 (looks really cool and stylish) and furiouspalladin_by_handoko (nostalgic nice and clean pixelart with a warm feel to it) most of all (I like games :)) closely followed by movingdots_by_lainz (perfectly wonderful effect, I can clearly see a "Loading..." inscription over it and a "hint of the day" slowly shifting in the bottom). I'm still not sure which project to vote for :)
I also liked the idea of bgragraphics_by_j (looks nice and I believe some people would find it a useful addition to their desktops) and duplo6_by_bylaardt (I've seen a lot of people actually enjoying playing dominoe in our country in the past).
An I'm still wondering if my "by-usefulness" approach and excessive use of smileys is applicable to a Graphics contest :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 02, 2017, 09:57:10 am
furiouspalladin_by_handoko
Really cool fully playable game which actually has it all. Thou the controls are horrible :) I always move in the wrong direction instead of attacking enemies. My max score was 23... One more thing, I couldn't close the game GUI window, only by closing the console window I could close the game (Win7x64)

You can exit the game by simply pressing [Esc] once or twice. Yep, I admit the close icon on the titlebar is not functioning, I don't know why and don't know how to fix it.

Controlling the game is not hard if you know how. As a paladin you should be brave, don't just standing and waiting enemy to approach you. You should walk toward an enemy and when you get near of it then press the opposite ctrl key. For example you press right ctrl to move right to get near an enemeny, without releasing the right ctrl then press left ctrl to change to attack mode. So, you should use 2 hands to play this game, each hand holding a ctrl key.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 02, 2017, 12:40:24 pm
I seldom have (or want) time to play games so I probably approach this review with a ‘twisted’ opinion :)

Ball
Agree with Eugene   BUT    I have beaten it  - by holding the mouse button down on the background I can move the cursor on top of the ball - it only moves on Mouse-Up.

Duplo6
I think the graphics and animation are superb but as I mentioned before, I found some problems with the actual logic.
In today’s testing my ‘hand’ had a 3-5 and a 5-3 but when the second one was played it became a 5-5. Similarly I had two 2-3 tiles and the second became a 2-5. On another occasion it appeared that I couldn’t ‘go’ but it waited for my play, only continuing when I played a 3-3, which became a 0-6.
I’m using a 1280 x 1024 display and the whole board fills the height which interferes with the task-bar. Changing the height only changes the window size which hides the ‘hand’ at the bottom. It would be useful if the 'board' scaled with the window size.
            
Furious Palladin
I had two issues with this (one not yet resolved). Initially AVAST blocked it as potentially dangerous but I later had a message from them saying that it had been tested and added to their database as a ‘Good’. I can’t get it to run as it complains about  ‘allegro_image-5.2.dll’  missing. I have copied this to the program directory but presume that I need to register it which I am cautious about.

glslideshow
I can load .JPG images which I see in the pre-view pane and can select the animation type but when running, all I see are white rectangles on a black ground, Yes, they animate as expected, but don’t display the image. Like Eugene I would prefer the option to bulk load and to have formats other than .JPG available.

mariocronch
Perhaps it’s the fact that I am not a ‘gamer’ but I can only make Mario jump with the up-arrow and don’t get a penalty on a collision with either obstacle. Animation smooth and sound unobtrusive.

movingdots
Potentially mesmeric display emulating a snow or sand-storm and could well be useful as a 'Splash' screen. On exit I get a Heap Dump warning, though it does report 0 unfreed memory blocks.

movingdotsgl
This opens a full screen white window and then crashes with an app-crash report
Problem Event Name:   APPCRASH
  Application Name:   movingdotsgl.exe
  Application Version:   0.0.0.0
  Application Timestamp:   00000000
  Fault Module Name:   StackHash_6521
  Fault Module Version:   0.0.0.0
  Fault Module Timestamp:   00000000
  Exception Code:   c000041d
  Exception Offset:   74034f0d
  OS Version:   6.1.7601.2.1.0.256.1
  Locale ID:   2057
  Additional Information 1:   6521
  Additional Information 2:   6521cdc86a112061028218551989cce5
  Additional Information 3:   d377
  Additional Information 4:   d3773384d5d5027faab34440da99a06d


relogio
Great ‘controls’ with infinite scaling and although it is possible to hide the controls by pushing the ‘splitter’ to the right edge of the window  I would prefer a [button] to remove the ‘form’ altogether once the controls have been adjusted. A further (hidden?) button to close or recover the controls would also be needed of course.

starsfieldshooter
Refuses to run due to missing .dll

steampunkclock
To properly evaluate this would take quite some time and require some external work in creating clock-face and hand images so I’ll limit my review to the excellent samples.
These are very good sample designs but I notice a small alignment discrepancy with the seconds hand on all of them using a ‘one-second’ tick (most noticeable on the ‘Kitchen’ version). This may be down to an error in a constant or could be a mis-alignment of a bitmap. (I had a number of similar issues with my Pocket Watch which needed bitmaps re-creating with a small shift to make sure the hand aligned with the dial mark). This is in stark contrast to the Religio clock which is absolutely ‘spot on’.            
On the ‘Neon’ version the sub-seconds dial in red is indistinct and I can’t see an option to change that - other than creating a replacement .PNG file!

I do not see a ‘blink’ onmouseover as reported by Eugene nor on my Pocket Watch at each second. My TTimer interval is 1/100th second so there shouldn’t be a ~1 sec. event.

I'm also conflicted regarding a 'vote' - - - SteamPunk could be useful if it could create a stand-alone clock. Duplo6 is (for me) the best animation but of course I haven't seen Furious Palladin or starsfieldshooter
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 02, 2017, 12:53:30 pm
bgragraphics_by_j-g_(pocketwatch)
Looks cool and stylish.
Thanks for your comment Eugene. You haven't mentioned it, and the only instructions are in the .lpi file, so I assume that you haven't 'opened' the case or viewed the 'movement'. I would be pleased to be dis-abused of this opinion :)

Quote from: Eugene Loza
However, I've ran into a bug, that it blinks ~1 times per second :) / Win7x64
I'm also on Win 7x 64 and, as you see in my review, there is no ~1 sec. event.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 02, 2017, 01:12:59 pm
Furious Palladin
I had two issues with this (one not yet resolved). Initially AVAST blocked it as potentially dangerous but I later had a message from them saying that it had been tested and added to their database as a ‘Good’. I can’t get it to run as it complains about  ‘allegro_image-5.2.dll’  missing. I have copied this to the program directory but presume that I need to register it which I am cautious about.

glslideshow
I can load .JPG images which I see in the pre-view pane and can select the animation type but when running, all I see are white rectangles on a black ground, Yes, they animate as expected, but don’t display the image. Like Eugene I would prefer the option to bulk load and to have formats other than .JPG available.

Thanks for the test.

In my test, I didn't need to install/register allegro_image-5.2.dll. I guess your antivirus blocked it. You can try to whitelist it on your antivirus settings.

I found a bug in glslideshow, which I think is the problem that makes it fails to load jpeg images. Hopefully I can release the fix version tomorrow.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 02, 2017, 01:47:32 pm
In my test, I didn't need to install/register allegro_image-5.2.dll. I guess your antivirus blocked it. You can try to whitelist it on your antivirus settings.
As a quick test I just disabled my AV and tried again but with the same result. Could it be that the .DLL needs to be in c:/.../sytem32 - - - or some other 'specific' location?
Quote from: Handoko
I found a bug in glslideshow, which I think is the problem that makes it fails to load jpeg images. Hopefully I can release the fix version tomorrow.
That's at least a result :)   but it seems that ONLY .JPG images are allowed. Well, at least I can't find a way to specify any other file-type.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 02, 2017, 08:03:09 pm
duplo6_by_bylaardt
Looks like a very nice game, thou I can't play dominoe :) I didn't even understand the rules :)
To learn you need:
1 Table - Preferably in a public square;
1 partner;
2 oponents
several beer bottles

As you can see, it's a very complex game, it requires years of improvement.
It's no wonder you can see just elderlies playing.

Now serious:
I know that partnership dominoes is popular game only in some countries. That's why I believe this game (electronic format) is unique, and that's why I've chosen it. I really  recommend you learn, not this electronic version but the real live version, with real people's, real partnership and in a public place.
it's not just a game, is a therapy. I really  recommend you learn, not this electronic version but the real live version, with real people's, real partnership and in a public place.
Here in south of Brazil beer can be optional when you replace it with a drink knowed as "chimarrão" - matte herb tea without suggar - or by a coffe if you go to play on a coffe shop.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Eugene Loza on August 02, 2017, 09:26:02 pm
duplo6_by_bylaardt
Looks like a very nice game, thou I can't play dominoe :) I didn't even understand the rules :)
To learn you need:
1 Table - Preferably in a public square;
1 partner;
2 oponents
several beer bottles
It has been extremely popular in our country exactly with the same conditions  ;D
I've been playing this variant of the game when I was a child: https://www.youtube.com/watch?v=23fBoqQxSgQ :) Couldn't find it with English subs... And automatically recognized subs are wrong...
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 02, 2017, 09:53:29 pm
In Argentina we play Domino this way:
- 1 vs 1
- at first, each player takes 7 pieces
- then we start with a double one (0:0, if not in hand then 1:1, 2:2 and so on..) that is in the hand of any of the two players. else if no piece meets the requeriments I don't know :) usually that doesn't happens  :o
- each player positions a piece (in his turn), if the player doesn't have one with one of the extreme numbers, must take one from the heap of pieces, as many as he can put one in the game.
- wins the one that holds zero pieces in his movement
- if the game ends before one get's zero pieces (like no more valid movements), wins the one with less pieces in hand
Title: Re: Graphics Contest 2017, please vote now!
Post by: Eugene Loza on August 02, 2017, 10:30:34 pm
In Argentina we play Domino this way:
Yep, exactly the same rules I know.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 02, 2017, 10:49:14 pm
just "partnership double six" is not so popular.
individual dominoes is very popular around the world.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 02, 2017, 11:06:00 pm
Hello all !  :)
I've finally finished (it's never finished...) my game Educ'Race. It have 9 stages in which car's player must take the good number that appear on the road, according to the selected multiplication table (from 2 to 9, randomly).
I have added some effects like rain, snow, fog, night when car is in a tunnel, etc...
I've also written Tile Map Designer, a small editor for make the game's map.

I have no idea if it compile on different platform than windows. It use TOpenGLControl.

Thanks you to have a try ! :)


Game windows executable
http://www.lulutech.fr/EducRace/EducRace.7z (http://www.lulutech.fr/EducRace/EducRace.7z)

Tile Map Designer windows executable
www.lulutech.fr/EducRace/TileMapDesigner.7z (http://www.lulutech.fr/EducRace/TileMapDesigner.7z)

Source
http://www.lulutech.fr/EducRace/EducRaceSrc.7z (http://www.lulutech.fr/EducRace/EducRaceSrc.7z)

@Circular: I allowed myself to use your 'Water_improved' that you have posted on a topic in this forum, in the splash screen at the beginning of the game.  :-[ Thanks for this code !
Title: Re: Graphics Contest 2017, please vote now!
Post by: jc99 on August 03, 2017, 01:24:33 am
@Lulu,
Game doesn't run due to missing openal32.dll
Could you please include it to your binary-archive
Thanks in advance
Title: Re: Graphics Contest 2017, please vote now!
Post by: taazz on August 03, 2017, 01:44:28 am
@Lulu,
Game doesn't run due to missing openal32.dll
http://www.openal.org/
Title: Re: Graphics Contest 2017, please vote now!
Post by: jc99 on August 03, 2017, 02:38:33 am
http://www.openal.org/
I know that, but you cannot load just the dll there you must choose between the win installer or the sdk-installer.
So why not include the missing dll like anyone else. This makes also sure the dll have the right version.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 03, 2017, 04:19:17 am
Hello all !  :)
I've finally finished (it's never finished...) my game Educ'Race. It have 9 stages in which car's player must take the good number that appear on the road, according to the selected multiplication table (from 2 to 9, randomly).
I have added some effects like rain, snow, fog, night when car is in a tunnel, etc...
I've also written Tile Map Designer, a small editor for make the game's map.

I have no idea if it compile on different platform than windows. It use TOpenGLControl.

Thanks you to have a try ! :)


Game windows executable
http://www.lulutech.fr/EducRace/EducRace.7z (http://www.lulutech.fr/EducRace/EducRace.7z)

Tile Map Designer windows executable
www.lulutech.fr/EducRace/TileMapDesigner.7z (http://www.lulutech.fr/EducRace/TileMapDesigner.7z)

Source
http://www.lulutech.fr/EducRace/EducRaceSrc.7z (http://www.lulutech.fr/EducRace/EducRaceSrc.7z)

@Circular: I allowed myself to use your 'Water_improved' that you have posted on a topic in this forum, in the splash screen at the beginning of the game.  :-[ Thanks for this code !

Thanks. I've added you to the poll so anyone can vote your project.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 03, 2017, 08:19:49 am
Thanks Lainz

http://www.openal.org/
I know that, but you cannot load just the dll there you must choose between the win installer or the sdk-installer.
So why not include the missing dll like anyone else. This makes also sure the dll have the right version.

Thanks for the feedback. I added OpenAL32.dll in the zip file. I hope it will work.

@Handoko, I like your game ! It reminds me of the old games I played when I was young :D

Can we expect september 1 to vote?
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 03, 2017, 11:48:51 am
@Lulu,
Game doesn't run due to missing openal32.dll
Could you please include it to your binary-archive
Thanks in advance
I had the same problem and I have now,
1 - downloaded the new file,
2 - confirmed that OpenAL32.dll is in the .exe folder

but - -  I now get a simple "The application was unable to start correctly (0x000007b)"  error message
Title: Re: Graphics Contest 2017, please vote now!
Post by: taazz on August 03, 2017, 01:35:57 pm
http://www.openal.org/ (http://www.openal.org/)
I know that, but you cannot load just the dll there you must choose between the win installer or the sdk-installer.
So why not include the missing dll like anyone else. This makes also sure the dll have the right version.
Because it has the complete installation and its the oficial distribution site.I do not know if the dll needs anything else or worst it needs a low level driver installed on the system. Why should I trust any one to share a clean non infected dll I prefer to go to the source which is their obligation to share clean non infected dlls with an installer that makes sure all requirements are met. Adding a dll in the release might or might not work it might work for you for example but for me because I'm using linux/xp/95 or what ever OS  it requires a bit more to be installed. Why gamble when you can be 100% certain.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 03, 2017, 01:52:36 pm
I have fixed a minor issue and added some improvements to glSlideshow.

At the beginning I want to make a pictures-to-video conversion tool, but because of the limited time I have it now only has the very basic features:

- Slide In Transitions (up, down, left, right)
- Fade To Background Transition
- Scale Up & Down Transitions
- Ribbon Transitions (left, up)
- Rotate Transitions (cw, ccw)
- Support wide range of image formats
- Use OpenGL rendering

Limitations:

- No support for resizing and full screen preview
- No audio support
- No text support
- Max. 5 slides
- Cannot remove slide
- Cannot save project
- Cannot export to avi/mpeg

I often help my friend to create videos of their family events. As a Linux user I use Kdenlive, DVD Styler, Pitivi, and OpenShot. None of them are suitable for production use. They are buggy and frequently crash or exit in the middle of working. It's been a long time I wanted to create a simple image/video slideshow tool that can export the result to video format.

glSlideshow is the early prototype of the tool I need and wanted to create. But I think I may not spend much time to make it to a finished program.

The supported image file format is based on TImage capability. Thanks Molly and Taazz for suggesting it.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 03, 2017, 02:03:48 pm
@Taazz, I understand, I removed OpenAL32.dll from the executable.
If someone want to test the game, please go to https://openal.org/ (https://openal.org/) to download the good dll for your os.
Thanks !

@Handoko, I can't found the source for your 'Furious Paladin' game. I'm interested how you differenciate the right control key from the left. One time I try to do it, I never succes...
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 03, 2017, 02:18:34 pm
In the previous post, I already mentioned I submitted/donated the code to Nuno. I let him check the code to make sure it conform to the 'standard'. After that, the code will be publicized.

He said, the license of Furious Paladin may need to change (maybe to zlib/libpng) to be able to published as the demo on his website. I agree with him.

If someone want to test my code, you can pm me. But only if you agree you do not make the code public. The code is 40 KB + 1.7 MB (image+audio), give my your email and I will send you them.

@Handoko, I can't found the source for your 'Furious Paladin' game. I'm interested how you differenciate the right control key from the left. One time I try to do it, I never succes...

Here is the code of ProcessUserInput:

Code: Pascal  [Select][+][-]
  1. procedure ProcessUserInput;
  2. const
  3.   EscJustPressed:   Boolean = False;
  4.   SpaceJustPressed: Boolean = False;
  5. var
  6.   KeyState:    ALLEGRO_KEYBOARD_STATE;
  7.   isFaceRight: Boolean;
  8.   isMoveLeft:  Boolean;
  9.   isMoveRight: Boolean;
  10.   isAttack:    Boolean;
  11.   isBusy:      Boolean;
  12. begin
  13.  
  14.   isBusy      := False;
  15.   isFaceRight := (Player.CurrentActivity = WalkR) or
  16.                  (Player.CurrentActivity = AttackR) or
  17.                  (Player.CurrentActivity = IdleR) or
  18.                  (Player.CurrentActivity = HitR);
  19.  
  20.   // Check keyboard input
  21.   al_get_keyboard_state(KeyState);
  22.  
  23.   // Esc
  24.   if al_key_down(KeyState, ALLEGRO_KEY_ESCAPE) then begin
  25.     if not(EscJustPressed) then
  26.       case AppState of
  27.         Playing: Start(Paused);
  28.         Lose, Win: Start(Intro1);
  29.         Intro1, Intro2, Paused: GameIsRunning := False;
  30.       end;
  31.     EscJustPressed := True;
  32.   end
  33.   else
  34.     EscJustPressed := False;
  35.  
  36.   // Space
  37.   if al_key_down(KeyState, ALLEGRO_KEY_SPACE) then begin
  38.     if not(SpaceJustPressed) then
  39.       case AppState of
  40.         Intro1: Start(Intro2);
  41.         Intro2, Paused: Start(Playing);
  42.         Lose, Win: Start(Intro1);
  43.       end;
  44.     SpaceJustPressed := True;
  45.   end
  46.   else
  47.     SpaceJustPressed := False;
  48.  
  49.   // Cannot do anything is being hit
  50.   if (Player.CurrentActivity = HitL) or (Player.CurrentActivity = HitR) then
  51.     Exit;
  52.  
  53.   // Moving or attacking
  54.   isMoveLeft  := al_key_down(KeyState, ALLEGRO_KEY_LCTRL);
  55.   isMoveRight := al_key_down(KeyState, ALLEGRO_KEY_RCTRL);
  56.   if (isMoveLeft and isMoveRight) then begin   // Do attack and disable moving if left & right shift pressed
  57.     isAttack    := True;
  58.     isMoveLeft  := False;
  59.     isMoveRight := False;
  60.   end
  61.   else
  62.     isAttack := False;
  63.  
  64.   // Move left
  65.   if isMoveLeft then begin
  66.     Player.CurrentActivity := WalkL;
  67.     isBusy := True;
  68.   end;
  69.   // Move right
  70.   if isMoveRight then begin
  71.     Player.CurrentActivity := WalkR;
  72.     isBusy := True;
  73.   end;
  74.   // Attack
  75.   if isAttack then begin
  76.     if isFaceRight then
  77.       Player.CurrentActivity := AttackR
  78.     else
  79.       Player.CurrentActivity := AttackL;
  80.     isBusy := True;
  81.   end;
  82.   // Idle
  83.   if not(isBusy) then begin
  84.     if isFaceRight then
  85.       Player.CurrentActivity := IdleR
  86.     else
  87.       Player.CurrentActivity := IdleL;
  88.   end;
  89.  
  90. end;
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 03, 2017, 02:30:30 pm
Sorry, I did not understand that you use Allegro library.
I thought you were using lazarus OnKeyDown, OnKeyUp callback in TForm to intercept keyboard.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 03, 2017, 04:01:11 pm
Additional reviews - in the light of code/instruction amendments.

Educ'Race
I've now 'Installed' OpenAL from the official site and eventually got Educ'Race to run but not without the error message "Cannot Load OpenGL 2.0 - no shader available" coming up twice and having to be dismissed.

Graphics and Sound excellent but I found the response to mouse or keyboard input 'sluggish'. This meant that I had to 'correct' mouse cursor (big green arrow) movement a number of times before it settled on a menu option - - - EXCEPT left/right arrow keys which with the slightest touch slammed the car into the wall :(   

This, of course, could just be the fact that I am not a 'gamer' :)


glSlideShow
Great to see multi-format options.  However, I still don't see the images after [Play], just white faders. Much more of an issue though, it took me many attempts to load more than one image, getting a SIGSEV error necessitating a re-start. This could be due to the size of image I attempted to load  - -  7Mb and 11.2Mb .TIF  along with 1.7Mb .PNG  - -  I never got as far as loading 5 images.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 03, 2017, 04:11:21 pm
@J-G
I think you have problems with your graphics card. Since my project didn't open too. Maybe the graphics drivers or is somewhat old card that doesn't support OpenGL 2.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 03, 2017, 04:16:23 pm
Did the white image issue happen on certain images only or all images? Can you provide me the 'problem' image? Did you test it on Win7 64-bit? I will tried to get a Win7 64-bit machine to test.

For you information, the program needs OpenGL to run properly. I guess the hardware should at least supports OpenGL 1.2. It used only the very basic OpenGL functions, I believe I didn't use any functions of version 1.5 nor above.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 03, 2017, 04:20:28 pm
I have a win 7 PC and works fine Handoko. So it's a problem with the graphics card.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 03, 2017, 04:44:40 pm
Thanks for test on Win7.

I guess it's my fault. I found a bug in BGRAtoRGBA procedure and fixed it some weeks ago. But because I have several projects using this procedure, I forgot to apply the fix on glSlideshow. The previous one has memory leak issue, which may cause SIGSEV error.

This one is the fixed version:

Code: Pascal  [Select][+][-]
  1. procedure BGRAtoRGBA(Image: TBitmap);
  2. var
  3.   Data: PRGBQuad;
  4.   Temp: Byte;
  5.   i : LongInt;
  6. begin
  7.   with Image do
  8.   begin
  9.     Data := Pointer(Image.RawImage.Data);
  10.     for i := 1 to Width * Height do
  11.     begin
  12.       Temp := Data^.rgbBlue;
  13.       Data^.rgbBlue := Data^.rgbRed;
  14.       Data^.rgbRed := Temp;
  15.       Inc(Data);
  16.     end;
  17.   end;
  18. end;

Also, I almost forget to mention - if you inspect the code, you will know - glSlideshow only support 32-bit version (PRGBQuad) image formats.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 03, 2017, 04:59:51 pm
@Handoko, I tested your OpenGl Slide Show on win10 64bits, it work great.
However, if I load 5 images, sequence is
N°1, N°2, N°3, N°5   N°4 is skipped
at this point, if I reload another image on N°4, sequence become
N°1, N°2, N°3, N°4  , now N°5 is skipped


@J-G, when you launch Educ'Race, please go to the second screen where you hear the music and could you say me what is the Frame per seconds please ? you could see this information at the top left windows game
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 03, 2017, 05:10:27 pm
about slideshow:

@ handoko
bug easy to fix: if you add 5 images, the 4th never show.
is a great inspiration to create a component to rotate images, i love it.

@J-G
just update your bgracontrols and your bgrabitmap.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 03, 2017, 05:11:37 pm
ups, lulu was faster
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 03, 2017, 05:16:21 pm
@J-G, when you launch Educ'Race, please go to the second screen where you hear the music and could you say me what is the Frame per seconds please ? you could see this information at the top left windows game
That is undoubtedly the 'issue' - - - even as a non-gamer I can appreciate that 1 to 7 FPS is hardly going to provide a good experience :)

I did once see 11fps but over three runs of the music the general figure is between 3 & 5. The music is played at what I would consider 'normal' speed.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 03, 2017, 05:42:26 pm
Thanks J-G for your informations, but I have no idea and no solution for this...
This is the first time I publish a program here, I have no experience in cross platform programming.
Even with the same OS, hardware can cause issue...  %)
The people who wrote lazarus and freepascal are amazing !
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 03, 2017, 06:09:21 pm
Did the white image issue happen on certain images only or all images? Can you provide me the 'problem' image? Did you test it on Win7 64-bit? I will tried to get a Win7 64-bit machine to test.
Yes it was all images. Yes I have found an image which ALWAYS causes an error at line 108 of your latest BGRAtoRGBA Procedure :
Code: Pascal  [Select][+][-]
  1. Temp := Data^.rgbBlue;
and would be happy to send it to you......   I've looked at attaching it to an e-mail but can't see a means of doing that via the forum facility. Therefore I've put it on my web-site :
www.crescentcomputing.co.uk/handoko
Nothing special - a .TIF file of 797k but too large to 'attach' here.

Quote from: Handoko
For your information, the program needs OpenGL to run properly. I guess the hardware should at least supports OpenGL 1.2. It used only the very basic OpenGL functions, I believe I didn't use any functions of version 1.5 nor above.

My graphics card is an NVIDIA GeForce 9500 GT with 1Gb GDDR2 and the spec. tells me that it supports Open GL 2.1.

I presume that I don't need to 'install' Open GL explicitly, I would anticipate that would be have been done when I installed the video drivers for the card - but since I have never needed to 'use' Open GL what would I know? ;D
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 03, 2017, 06:50:38 pm
My graphics card is an NVIDIA GeForce 9500 GT with 1Gb GDDR2 and the spec. tells me that it supports Open GL 2.1.

I presume that I don't need to 'install' Open GL explicitly, I would anticipate that would be have been done when I installed the video drivers for the card - but since I have never needed to 'use' Open GL what would I know? ;D

Usually with NVIDIA graphics cards, the Windows driver provided by Windows, or Windows Update doesn't come with latest OpenGL support. I always used to install the NVIDIA drivers from his website.

I had that problem years ago, with my NVIDIA graphics card, exactly the same: with lazarus opengl applications not working, now I use the Intel HD Graphics that comes with the processor.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 03, 2017, 08:31:32 pm
I have fixed 2 issues. Sorry I had not tested it properly. :-[
- Order error no #4 and #5
- Now support 24-bit TIFF format

However, if I load 5 images, sequence is
N°1, N°2, N°3, N°5   N°4 is skipped
at this point, if I reload another image on N°4, sequence become
N°1, N°2, N°3, N°4  , now N°5 is skipped

Fixed, just a typing mistake.

Yes I have found an image which ALWAYS causes an error at line 108 of your latest BGRAtoRGBA Procedure :
Code: Pascal  [Select][+][-]
  1. Temp := Data^.rgbBlue;

That happens because that image is 24-bit TIFF format. Now I added support for it by manually convert it to 32-bit before calling BGRAtoRGBA:

Code: Pascal  [Select][+][-]
  1.   // Convert 24-bit TIFF image to 32-bit
  2.   S := UpperCase(ExtractFileExt(OpenPictureDialog1.FileName));
  3.   if ((S = '.TIFF') or (S = '.TIF')) and (SlideImages[Index].PixelFormat = pf24bit) then
  4.     begin
  5.       TmpBitmap := TBitmap.Create;
  6.       TmpBitmap.PixelFormat := pf32bit;
  7.       TmpBitmap.Width := SlideImages[Index].Width;
  8.       TmpBitmap.Height := SlideImages[Index].Height;
  9.       Data32bit := Pointer(TmpBitmap.RawImage.Data);
  10.       Data24bit := Pointer(SlideImages[Index].RawImage.Data);
  11.       for y := 0 to (TmpBitmap.Height-1) do
  12.       begin
  13.         Data32bit := TmpBitmap.ScanLine[y];
  14.         Data24bit := SlideImages[Index].ScanLine[y];
  15.         for x := 1 to TmpBitmap.Width do
  16.         begin
  17.           Data32bit^.rgbRed   := Data24bit^.rgbtRed;
  18.           Data32bit^.rgbGreen := Data24bit^.rgbtGreen;
  19.           Data32bit^.rgbBlue  := Data24bit^.rgbtBlue;
  20.           Inc(Data24bit);
  21.           Inc(Data32bit);
  22.         end;
  23.       end;
  24.       SlideImages[Index].Assign(TmpBitmap);
  25.       TmpBitmap.Free;
  26.     end;
Title: Re: Graphics Contest 2017, please vote now!
Post by: circular on August 03, 2017, 09:03:33 pm
Hi everyone.

I had no time for anything. So anyway I will vote for the Sudoku. I find it very classy.

If it can help, here is a sudoku program I made that gives hints (or try to solve it) using human-like methods. This could be added to provide hints in the sudoko program already submitted.

Regards
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 04, 2017, 12:13:45 pm
Sorry, handoko, I've found another 'exception' that causes a SIGSEGV error but this time at line 109.

What I am pleased about is that I think I can tell you exactly what the problem is - - - the .TIF image is ......... MONOCHROME ............   ie. 8-bit       and I don't see any reference in your code to 8-bit images.

I'm assuming that you (or Open GL) interpret CMYK images as 32-bit and RGB images as 24-bit   ie. 8 bits per 'colour'.

I could be completely wrong here but it is an interesting exercise - and exactly what this 'contest' is about.

Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 04, 2017, 12:45:03 pm
Please send me the image, so I can inspect and test.
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on August 04, 2017, 01:08:57 pm
If it can help, here is a sudoku program I made that gives hints (or try to solve it) using human-like methods. This could be added to provide hints in the sudoko program already submitted.
Thanks, but it was just a matter of finding time  ;)  The TSudoku class has a results-array that is generated also. Application could as a hint show any one of those numbers that isn't already filled in place. But there is also 1 flaw in generation algorithm, that it doesn't verify yet if there only is only 1 solution when numbers are removed from original. So i left fill ratio to just 0.5 which makes so easy sudoku's i can always solve them myself. In difficulty ratio in general sudoku magazines from 1 to 5 stars (5 hardest), i would class these about 2 or 3.
Title: Re: Graphics Contest 2017, please vote now!
Post by: circular on August 04, 2017, 02:04:10 pm
@User137 do as you wish. I will just mention that with my algorithm, you get only suggestions that have only one possibility and gives a hint on the method to use : either it is constraint on a square, on a column or on a cell.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 04, 2017, 06:52:16 pm
Please send me the image, so I can inspect and test.
Sorry for the delay - I had a customer to visit.

The mono file is 'Snowflake BW.png' and is now on my web-site.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 05, 2017, 11:33:29 am
Please send me the image, so I can inspect and test.
Sorry for the delay - I had a customer to visit.

The mono file is 'Snowflake BW.png' and is now on my web-site.

There is something I cannot explain. Try this code on your 'snowflake BW.png':

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   Image1.Picture.LoadFromFile('snowflake BW.png');
  4. end;

I tested the code above using Lazarus 1.6.4 Gtk2 on Linux 64-bit. It quit immediately without showing any error. I tried to use GIMP to re-save the image (File > Overwrite snowflake BW.png) without modifying anything. The re-saved file can be open using the code above.

Original size of 'snowflake BW.png' : 33396 bytes
Re-saved size of 'snowflake BW.png' : 40228 bytes

My guess is maybe that mono png file format is not supported by TPicture or maybe that file is using non-standard format. Or maybe there is a bug on Linux Gt2 only? Can anyone test it on other OSes?

So, because the original 'snowflake BW.png' cannot be opened using TImage.Picture.LoadFromFile, nothing I can do now.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 05, 2017, 12:52:51 pm
@Handoko
I tested a simple project with  TImage.Picture.LoadFromFile('snowflake BW.png')

It work fine on my computer, the image of the flake appears on the screen.

Windows 10, Lazarus 1.6.4
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 05, 2017, 04:47:15 pm
There is something I cannot explain. Try this code on your 'snowflake BW.png':

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   Image1.Picture.LoadFromFile('snowflake BW.png');
  4. end;

I tested the code above using Lazarus 1.6.4 Gtk2 on Linux 64-bit. It quit immediately without showing any error. I tried to use GIMP to re-save the image (File > Overwrite snowflake BW.png) without modifying anything. The re-saved file can be open using the code above.

Original size of 'snowflake BW.png' : 33396 bytes
Re-saved size of 'snowflake BW.png' : 40228 bytes
The ORIGINAL file was 40228 bytes   -  Curiouser and curiouser !!  -  unless you have accidentally transposed the two figures.

It opens in Photoshop/CorelDRAW! without problem and of course displays in the preview pane of Windows Explorer.

Quote from: Handoko
My guess is maybe that mono png file format is not supported by TPicture or maybe that file is using non-standard format. Or maybe there is a bug on Linux Gt2 only? Can anyone test it on other OSes?

So, because the original 'snowflake BW.png' cannot be opened using TImage.Picture.LoadFromFile, nothing I can do now.
I tried inserting that line of code at the start of your TForm1.BackgroundClick Procedure with the intention of 'stepping through'  - -  having declared   Image1 : TImage   locally. As soon as it tries to execute that line it throws a SIGSEGV error pointing to Line 770 in picture.inc.

I've done nothing with the image regarding the format, it's a straight Mode change in Photoshop, removing the colour information and then converting the 'Grey Scale' to 'Bitmap' - but it was saved with 'Interleave' on. I've now re-saved with  interleaving = none  and the size is 30245 bytes  -  so that is a difference  -  the new file is on my web-site if you want to test that, though it threw the same error.

Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 05, 2017, 05:27:48 pm
One recommendation I might make for Handoko's Slideshow project that would immediately solve all image-format issues is to simply use BGRABitmap! The TBGRABitmap class is capable of loading pretty much any image file type that you'd ever want to, and it exposes a "Data" property that can be used to load it into OpenGL. Here's a modified version of the texture creation routine I've been using in DeleD, that loads an image (of any format supported by BGRABitmap) from file and returns an OpenGL handle that you can then bind with glBindTexture.

Code: Pascal  [Select][+][-]
  1. function CreateOpenGLTexture(FileName: String; WrapMode: Cardinal = GL_REPEAT; MinLODBias: Single = 0;
  2.   MaxLODBias: Single = 0; AnisotropyLevel: Single = 0): Cardinal;
  3. var
  4.   TextureHandle: Cardinal;
  5.   TempBitmap: TBGRABitmap;
  6. begin
  7.   TempBitmap := TBGRABitmap.Create(FileName);
  8.   glGenTextures(1, @TextureHandle);
  9.   glBindTexture(GL_TEXTURE_2D, TextureHandle);
  10.   glTexParameterI(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, WrapMode);
  11.   glTexParameterI(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, WrapMode);
  12.   glTexParameterF(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLODBias);
  13.   glTexParameterF(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLODBias);
  14.   glTexParameterI(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
  15.   glTexParameterI(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  16.   if AnisotropyLevel <> 0 then
  17.     glTexParameterF(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, AnisotropyLevel);
  18.   glTexParameterI(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
  19.   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TempBitmap.Width, TempBitmap.Height, 0, GL_BGRA, GL_UNSIGNED_BYTE, TempBitmap.Data);
  20.   glBindTexture(GL_TEXTURE_2D, 0);
  21.   TempBitmap.Free;
  22.   Result := TextureHandle;
  23. end;
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 05, 2017, 05:30:09 pm
Original size of 'snowflake BW.png' : 33396 bytes
Re-saved size of 'snowflake BW.png' : 40228 bytes
The ORIGINAL file was 40228 bytes   -  Curiouser and curiouser !!  -  unless you have accidentally transposed the two figures.
Sorry my mistake.

I cannot open both your 'snowflake BW NonInt.png' and 'snowflake BW.png' using TImage.Picture.LoadFromFile on my Linux64 computer. I can open them using GIMP and my Linux built-in image viewer.

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Forms, Dialogs, ExtCtrls, StdCtrls, ExtDlgs;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     Image1: TImage;
  17.     OpenPictureDialog1: TOpenPictureDialog;
  18.     procedure Button1Click(Sender: TObject);
  19.   end;
  20.  
  21. var
  22.   Form1: TForm1;
  23.  
  24. implementation
  25.  
  26. {$R *.lfm}
  27.  
  28. { TForm1 }
  29.  
  30. procedure TForm1.Button1Click(Sender: TObject);
  31. begin
  32.   OpenPictureDialog1.Execute;
  33.   Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
  34.   Caption := OpenPictureDialog1.FileName;
  35. end;
  36.  
  37. end.

If I open 'snowflake BW NonInt.png' or 'snowflake BW.png', I can see the titlebar changed to the file name. But nothing happened, sometimes the program just exit immediately. But if I open the image saved using GIMP, it works correctly. Can anyone please download loadimage.zip and test it?

One recommendation I might make for Handoko's Slideshow project that would immediately solve all image-format issues is to simply use BGRABitmap!

I ever thought about it. But now there is mystery needed to be solved.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 05, 2017, 05:33:13 pm
I've now made time to check other 'Monochrome' images - or more precisely 8 bit Black/White images (rather than 'GreyScale') and every one fails. 

Most with a SIGSEGV but some with 'Offset Error'.

'GreyScale' are OK.

I've put a few on my web-site for testing.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 05, 2017, 05:41:25 pm
One recommendation I might make for Handoko's Slideshow project that would immediately solve all image-format issues is to simply use BGRABitmap! The TBGRABitmap class is capable of loading pretty much any image file type that you'd ever want to...

That's true. I remember some old days when I provide Circular all the possible image formats of .psd files, and thanks to his work every single one was loaded fine with LazPaint.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 05, 2017, 05:58:44 pm
At the beginning I want to use just Lazarus' built-in libraries/units so users can easily compile and run the code. And you know, we hear a lot of users have problem installing TBGRABitmap.

Well, I think I should not reinvent the wheel. I will use BGRABitmap in glSlideshow.

@J-G

I test your images, only 'Card Background.tif' is able to open using the LoadImage code:
✗ 3-4.tif
✗ BSL Logo.tif
✔ Card Background.tif
✗ snowflake BW NonInt.png
✗ snowflake BW.png
✗ vonEssen.tif

Tested on Lazarus 1.6.4 Gt2 Ubuntu Mate 16.10. If it failed, it show no error and sometimes it exit immediately.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 05, 2017, 07:31:41 pm
I never had problems installing BGRABitmap on released lazarus and fpc both in Windows and Linux, the problems comes when using untested trunk builds of fpc and lazarus.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 05, 2017, 08:57:29 pm
@J-G
I test your images, only 'Card Background.tif' is able to open using the LoadImage code:
✗ 3-4.tif
✗ BSL Logo.tif
✔ Card Background.tif
✗ snowflake BW NonInt.png
✗ snowflake BW.png
✗ vonEssen.tif

Tested on Lazarus 1.6.4 Gt2 Ubuntu Mate 16.10. If it failed, it show no error and sometimes it exit immediately.

I'm pleased to find that you have the same problems that I do - at least that means that my system isn't the culprit !!

The Card Background is the only RGB (24bit) image and of course you had already solved the 32/24 bit issue.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 07, 2017, 01:05:17 am
Had some free time today, so just for fun I did a bit of a rewrite of Handoko's Slideshow project (using BGRABitmap like I had suggested, along with some other changes to the rendering code). Obviously this isn't a contest entry or anything, moreso just something I did as an example/learning template for others. I've attached a zip file that includes the changed files/forms. You'll need to add BGRABitmap to the projects requirements in order to use them, of course.

EDIT: Forgot to change the OpenDialog to be able to recognize non-JPEG images. Ended up just making it an OpenPictureDialog so I wouldn't have to type out every file extension manually, and re-uploaded the zip file.

EDIT (again): Realized I had broken the timing code. Fixed it. Re-uploaded. Everything should work as intended now. Don't drink and code, kids!

EDIT, Part III (Bigger And Editier): posted this below but will post it up here as well. If you're on Windows neither of the following two things are necessary, but if you're on Linux, change line 30 of "uniGraphics.pas" to look like this:

Code: Pascal  [Select][+][-]
  1. {$IFDEF WINDOWS}
  2.   TexCoords: array[0..7] of SmallInt = (0, -1, 1, -1, 1, 0, 0, 0);
  3. {$ELSE}
  4.   TexCoords: array[0..7] of SmallInt = (0, 1, 1, 1, 1, 0, 0, 0);
  5. {$ENDIF}

And at around line 415 of same unit, in the "CreateOpenGLTexture" function, change it to look like:

Code: Pascal  [Select][+][-]
  1. {$IFDEF WINDOWS}
  2.   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TempBitmap.Width, TempBitmap.Height, 0, GL_BGRA, GL_UNSIGNED_BYTE, TempBitmap.Data);
  3. {$ELSE}
  4.   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TempBitmap.Width, TempBitmap.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, TempBitmap.Data);
  5. {$ENDIF}

Edit 4/Update: Added the above defines directly to the source. Also completely did away with the use of the fixed-function OpenGL matrix transformation API, replacing it with two "advanced record" types: TMatrix, which can Scale/Rotate/Translate/Multiply itself, and TCamera, which uses a TMatrix internally and uploads the final transformed data from it directly with glLoadMatrixF. Lastly, I changed the array of TBGRABitmaps to simply be an array of filename strings, so that they're only in memory temporarily when being loaded into OpenGL and assigned to the TBitButton glyphs. I've re-attached an updated version of the zip file with all of these changes, of course. Probably done playing around with the source for now, although I might re-visit it later.

Edit 5: Made a few more refinements/fixes/changes... All of the rendering functionality is now wrapped in advanced records (TSlideShowRenderer and TSlideShowConstants, as well as the previously mentioned TMatrix and TCamera) to allow for a nice object-oriented user/programmer experience. I also added RibbonRight and RibbonDown transitions, as it seemed like something was missing with only RibbonLeft and RibbonUp. Re-uploaded the zip file. Really done now!

Edit 6: Finished up a rough/naive take at merging the features from Handoko's latest version with my modified one. It includes all of the transition types as well as the same ability to load an infinite number of slides. I didn't get around to adapting the more extraneous features such as the slide re-ordering yet, though. Also, the TOpenGLControl now has a TSplitter on both the side and bottom, so you can resize it freely within the form. New zip file is attached.

Edit 7: My version now has all of the same right-click popup-menu-based slide reordering and removal functionality that Handoko's last update did. More interestingly/importantly, I also implemented the ability to save and load your slide/transition lineups to and from file, which Handoko had said was an intended feature. This is accessed through a standard "File" menu at the top of the form. Apart from that, I reworked the way I implemented some of the transitions a little bit as I realized I had caused weird scaling problems in certain edge cases. Again, I've attached a new zip file.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 07, 2017, 04:29:51 am
Yes, it works. Thank you for the improvement. But it did not work correctly. The image flipped upside down.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 07, 2017, 04:43:12 am
Can you upload the image that was displaying upside-down? Would be interested in testing it... by default BGRA-format images will in fact display upside down when loaded into OpenGL, so I simply inverted your original texture coordinates (which were presumably intended for RGBA), and that was enough to have them display JPEG, PNG, BMP, TGA, GIF and other files correctly for me (on Windows, at least.) Obviously you're on Linux, so there might be something additional going on there that isn't going on on Windows. Either way it's probably an easy fix!
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 07, 2017, 04:56:32 am
I tested several images (*.tif, png, jpg), all of them are upside down. Also the color blue became pale orange as you can see the logo of Lazarus below. Tested on Lazarus 1.6.4 64-bit BGRABitmap 9.5 Ubuntu Mate 16.10.

Previously, my code called BGRAtoRGBA procedure to fix the color issue.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 07, 2017, 04:59:02 am
Figured it out. It seems on Linux, BGRABitmap invokes its own built-in bit-reordering method by default when you load images. At line 30 of "uniGraphics.pas", change it to look like the following:

Code: Pascal  [Select][+][-]
  1. {$IFDEF WINDOWS}
  2.   TexCoords: array[0..7] of SmallInt = (0, -1, 1, -1, 1, 0, 0, 0);
  3. {$ELSE}
  4.   TexCoords: array[0..7] of SmallInt = (0, 1, 1, 1, 1, 0, 0, 0);
  5. {$ENDIF}

And at roughly line 415 of the same unit, in the "CreateOpenGLTexture" function, change it to:

Code: Pascal  [Select][+][-]
  1. {$IFDEF WINDOWS}
  2.   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TempBitmap.Width, TempBitmap.Height, 0, GL_BGRA, GL_UNSIGNED_BYTE, TempBitmap.Data);
  3. {$ELSE}
  4.   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, TempBitmap.Width, TempBitmap.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, TempBitmap.Data);
  5. {$ENDIF}
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 07, 2017, 04:42:44 pm
sudoku, relogio & duplo6 are the projects more voted (2 votes each). We need more votes to define this!
Title: Re: Graphics Contest 2017, please vote now!
Post by: Eugene Loza on August 07, 2017, 04:57:07 pm
I wish I could give two votes, that'd be
"sudoku" by user137
"furiouspaladin" by handoko
still can't decide which one I liked better... It's so hard to make "one-in-all-out" vote...
Thou I couldn't test
"starsfieldshooter" by turrican (can't run)
"educrace" by lulu
yet.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 07, 2017, 05:00:10 pm
I wish I could give two votes, that'd be
"sudoku" by user137
"furiouspaladin" by handoko
still can't decide which one I liked better... It's so hard to make "one-in-all-out" vote...
Thou I couldn't test
"starsfieldshooter" by turrican (can't run)
"educrace" by lulu
yet.

That's not possible now, I can't edit the poll to accept more than one vote right now, that options was available only when I created the poll.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 07, 2017, 05:47:18 pm
sudoku, relogio & duplo6 are the projects more voted (2 votes each). We need more votes to define this!
I haven't voted yet.
Deadline is september 21, right?
glslideshow and educrace still evolving. Give them some time to finish. Both are nice projects.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 07, 2017, 10:47:47 pm
I attached a new zip file to my other post with further updated/refined/fixed versions of the units I modified in Handoko's glSlideshow, if anyone's interested. Probably the last one for now.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 08, 2017, 09:25:06 pm
Hello,

I think the game Educ Race will not evolve anymore because I do not have the knowledge to make it multi-platform. However, it uses OpenAL which is a library supported by lazarus, TOpenGLControl, a component of lazarus and BGRABitmap.

Did anyone try to compile Educ Race on Linux or Mac please ?
Remind that you need OpenAL installed on your computer,  http://www.openal.org/ (http://www.openal.org/)
TOpenGLControl and BGRABitmap package installed on Lazarus.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 08, 2017, 09:52:38 pm
What was the cross-platform issue you were having, exactly? Was it just that people didn't have OpenAL binaries on non-Windows platforms? Here's 32 and 64 bit ".so" builds from CodeTyphon's libraries folder, if that's all it was...

32-bit:
https://uploadfiles.io/mggx4 (https://uploadfiles.io/mggx4)

64-bit:
https://uploadfiles.io/z6ksm (https://uploadfiles.io/z6ksm)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 08, 2017, 10:17:39 pm
Thanks Akira for the links.

I don't know the cross platform issue because I never try to compile Educ Race on other OS than Windows.
I must confess that I never use other OS than Windows...  :-[
Title: Re: Graphics Contest 2017, please vote now!
Post by: Thaddy on August 08, 2017, 11:03:38 pm
I can't vote if the proper links are not added... 18 pages.... I do know I have a favorite, but am not reading everything back.. O:-)
Title: Re: Graphics Contest 2017, please vote now!
Post by: mica on August 09, 2017, 01:22:51 am
only one Vote for this good projects .... its hard ;)
Title: Re: Graphics Contest 2017, please vote now!
Post by: molly on August 09, 2017, 01:26:43 am
I can't vote if the proper links are not added... 18 pages.... I do know I have a favorite, but am not reading everything back.. O:-)
Unless i interpreted that wrongly: I used only a single link, this one (https://github.com/lazarusccr/GraphicsContest). Unfortunately i currently lack time to give everything a good spin.

only one Vote for this good projects .... its hard ;)
Not only that, i would even consider it a bit unfair competition.

If this turns out to be a annual competition with multiple competitors (or contributions) then it would imho be more fair to have different categories for which points could be awarded.

How to decide between a project that uses non or hardly any motion graphics but uses a graphics design that is absolutely stunning to the eye and a fully implemented game f.e. a shooter with multiple attack waves, music, sound-fx, hiscore table etc. ?

Some projects are perhaps excellent examples on how to use and/or apply certain techniques and or programming styles, while another project perhaps uses dreadful spaghetti-like code that should not really be considered a good example.

In past years the number of contributed projects was not very high in numbers, so awarding projects on different aspects was not very practical but this year there is quite a number of contributed projects and which could perhaps be awarded points for different categories.

Perhaps something to consider for the future, in case the number of entries exceeds a certain value.

2 cents or perhaps even less.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 09, 2017, 02:55:52 am
The contest is not over and any suggestion can be used to this contest. We can have a winner by the poll like that was the first idea I did and we can have the categories and say one winner by category, or 1st, 2nd, and 3rd place, and honorific mentions.

But that votes should be as comments by each vote. Say a vote by category.

We can have:
- games (ball, mariocronch, educrace, duplo6, sudoku, furiouspaladin)
- clocks (relogio, steampunkclock, pocket watch)
- effects (glslideshow, movingdots, movingdotsgl, starsfieldshooter)

Of course some of these can't be called exactly games or effects, but is what I build in some seconds, if a better category layout is proposed I will check it out.

Edit: about the quality of each project, is of course a point of view, different from the category. That goes for another contest while we prevent of using bitmaps or stunning graphics. Thats for each one to decide what is voting, if a .png or a sourcecode, or none of these and just likes the project by anything else. For that there's the possibility to inspect the code and run the executables.
Title: Re: Graphics Contest 2017, please vote now!
Post by: molly on August 10, 2017, 04:24:17 am
@lainz:
Thank you for your feedback and taking my suggestion into consideration.

Indeed the first goal of my post was to be able to have multiple winners such as one winner for each category. At least it would give the contributors some kind of indication on how good their entry competed. e.g. so that they can think to themselves: ok, i did not ended first in this category so next time i would have to make a better effort or perhaps pick another (new) category.

I think your choice of categories is already a very good one that mostly fits existing contributions. The slideshower is perhaps a bit more difficult to categorize as well as some of the entries that are listed as game but, you have to start somewhere. We can't all be winners just by 'inventing' a new category. Since you initiated/organized you are more than welcome to make a choice. You could always opt for allowing contributors to pick a category in which they would like to contest.

Indeed, the quality of a production is always subject to personal preference. But so is deciding which one is your favourite  ;)

My idea there was more meant to be able to give some feedback about a production so that a contributor would be able to improve on his/her skills. That could of course also be done outside the voting system. In that regards i am not too familiar with the available message-board voting plugins.

But you are also correct that it is for funs. Some examples can simply be put together in matter of a few seconds, and so it should be as this 'event' was initially meant as a (simple) showcase.
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on August 10, 2017, 12:00:09 pm
The binaries post is now buried to page 13 it seems, maybe they could be included in the first post?

https://github.com/lazarusccr/GraphicsContest/releases/tag/2017
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 10, 2017, 03:00:37 pm
@lainz:
Thank you for your feedback and taking my suggestion into consideration.

Thanks. I will keep that categories and anyone interested can vote, one vote for category.

The binaries post is now buried to page 13 it seems, maybe they could be included in the first post?

https://github.com/lazarusccr/GraphicsContest/releases/tag/2017

Sure.
Title: Re: Graphics Contest 2017, please vote now!
Post by: valdir.marcos on August 10, 2017, 03:57:31 pm
ball_by_raw
- Even when I click the ball (shrinking the screen), neither the game shows any message nor it closes the program;

bgragraphics_by_j-g_(pocketwatch)
- It's beautiful;

duplo6_by_bylaardt
- I liked it very much, but sometimes the number 5 does not paint correctly;
- I missed a message that I have to pass because I do not have a matching piece;

Furious Paladin RC3-win\FuriousPaladin.exe
- It does not open on Windows 7 Professional 64-bit;
- A message says that is because of an internet related problem;

glslideshow_by_handoko
- I really liked it;
- Can it be a component for Lazarus? Maybe on OPM?

mariocronch_by_ericktux
- I liked it;
- I missed the score and death of the game;

movingdots_by_lainz
- Interesting;

movingdotsgl_by_lainz
- Interesting;

relogio_by_bylaardt
- Spectacular;
- It took a while to start;

starsfieldshooter_by_turrican
- Amazing, but it did not close on ESC or on a limited time;

steampunkclock_by_bylaardt
- Impressive;

sudoku_by_user137
- Very beautiful;
- It took a while to start;


As I can only have one vote, my vote goes to:
duplo6_by_bylaardt

Next year, if possible, it would be a good idea to divide votes on categories.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 10, 2017, 04:41:49 pm
As I can only have one vote, my vote goes to:
duplo6_by_bylaardt

Next year, if possible, it would be a good idea to divide votes on categories.

Thanks for your vote. That vote should go in the poll (if not already).

And you can vote by category!

- games (ball, mariocronch, educrace, duplo6, sudoku, furiouspaladin)
- clocks (relogio, steampunkclock, pocket watch)
- effects (glslideshow, movingdots, movingdotsgl, starsfieldshooter)

Just choose one by category. Then comment here, your vote will be taken into consideration.

Maybe next year we can create a web application to vote by category, but the problem is how to control one vote by lazarus user... or we should create a new vote post by category and have independent poll in each one?
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 10, 2017, 10:44:21 pm
Hello :)
my Educ Race game don't appear in binary and source zip  :'(
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 10, 2017, 11:47:32 pm
Hello :)
my Educ Race game don't appear in binary and source zip  :'(

Done.

The first time I ran your game, it did not run due to antivirus check (AVG), then I forget it.

Nice game.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 10, 2017, 11:52:47 pm
Well I will vote:

Best Game: educ race
Best Clock: pocket watch
Best Effect: glslideshow

And in the poll I voted furious paladin, for best project of 2017.

It's time to vote!
Official contest 2017 repository:
https://github.com/lazarusccr/GraphicsContest

Download 2017 binaries:
https://github.com/lazarusccr/GraphicsContest/releases/tag/2017

And you can vote by category!

- games (ball, mariocronch, educrace, duplo6, sudoku, furiouspaladin)
- clocks (relogio, steampunkclock, pocket watch)
- effects (glslideshow, movingdots, movingdotsgl, starsfieldshooter)

Just choose one by category. Then comment here, your vote will be taken into consideration.
Title: Re: Graphics Contest 2017, please vote now!
Post by: valdir.marcos on August 11, 2017, 12:08:29 am
And you can vote by category!

- games (ball, mariocronch, educrace, duplo6, sudoku, furiouspaladin)
- clocks (relogio, steampunkclock, pocket watch)
- effects (glslideshow, movingdots, movingdotsgl, starsfieldshooter)

Just choose one by category. Then comment here, your vote will be taken into consideration.

Here my votes go:
- games (duplo6)
- clocks (relogio)
- effects (glslideshow)

Thanks.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 11, 2017, 11:18:19 am
Here my vote:
in the pool I voted Relogio

and by category:
- games  duplo6
- clocks  relogio
- effects  glSlideShow

Thanks for this context, it's great idea ! :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Josh on August 11, 2017, 11:29:40 am
My Vote
Best Game - EducRace
Effects = glSlideShow
Clocks = PocketWatch
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 11, 2017, 11:55:11 am

Best Game: Duplo6
Best Clock: pocket watch
Best Effect: movingdots

Naturally, I must think that my clock entry is 'best'   :D   but I don't think that I should be allowed to cast that vote so 'SteamPunk' should get it.

Taking account of all the 'issues' I encountered, (mostly due to my system constraints) my single Poll vote still goes to Duplo6.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 11, 2017, 04:24:10 pm
duplo6_by_bylaardt
- I liked it very much, but sometimes the number 5 does not paint correctly;
- I missed a message that I have to pass because I do not have a matching piece;
about message, i use diferent sounds when you play and when not. But by the contest link "toc.wav" are missing.
you can find it on https://github.com/bylaardt/duplo6
use right click menu to turn sounds on/of.
If you are compiling then be sure you are using the bgrabitmap-9.5( or above? )

Naturally, I must think that my clock entry is 'best'   :D   but I don't think that I should be allowed to cast that vote so 'SteamPunk' should get it.
It's the best, and my inspiration to make steampunk.

By category:
Best Game: Sudoku (sorry, but i love board games and puzzles) 
Best Clock: pocket watch (Nothing new that could improve my skills in Relogio ou StemPunkClock ;) )
Best Effect: movingdots
Best Original Idea: FuriousPaladin
Best inspiration to create a new component: glslideshow

PS: I have provided "relogio" with the intention of having a start for this contest. It surprise me have a category just for watches.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 12, 2017, 11:01:45 pm
Made one final set of changes to the files from Handoko's glSlideShow, if anyone reading this is one of the people who've been downloading them. Details and a new zip file are in my original post, like before.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 13, 2017, 12:14:47 pm
Thanks J-G for your information, but I have no idea and no solution for this..
@Lulu  -  I have now found a solution  -  well at least I now show a frame rate which is 'sensible' - anything between 70+ and 120 - didn't test too long - and I have been able to 'play' Educ'Race - finding oil-slicks and knocking motor-cyclists off the track  :D   If I were a gamer I might actually like it :)

This is after updating my video driver to handle Open GL and finally being able to install 'Blender'  - only took me a week  %) (not that I can really use it yet!).

I thought that that might also solve the issues I have with Sudoku but sadly not - that still just displays what I assume is a 'splash' screen after complaining that it can't find 'tile.png'.

Furious Paladin still complains that I don't have allegro-5.2.dll even though that is in the .exe folder, and Star Field Shooter complains about xinput1_3.dll.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 13, 2017, 01:09:15 pm
Furious Paladin still complains that I don't have allegro-5.2.dll even though that is in the .exe folder
On which Windows?  Win7 32-bit or Win7 64-bit? I'll try get myself a Win7 machine for testing.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 13, 2017, 01:10:49 pm
Made one final set of changes to the files from Handoko's glSlideShow, if anyone reading this is one of the people who've been downloading them. Details and a new zip file are in my original post, like before.
Since updating my video driver I can now see the images :)  -  result.

Because I am still using BGRABitmap < 9.5 I can't re-compile the latest version but at least I can now appreciate what the program does AND I can confirm that the original program does handle 8 bit  (B & W) .JPG images.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 13, 2017, 01:15:32 pm
Furious Paladin still complains that I don't have allegro-5.2.dll even though that is in the .exe folder
On which Windows?  Win7 32-bit or Win7 64-bit? I'll try get myself a Win7 machine for testing.
Win 7 Ultimate 64 bit
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on August 13, 2017, 03:26:59 pm
I thought that that might also solve the issues I have with Sudoku but sadly not - that still just displays what I assume is a 'splash' screen after complaining that it can't find 'tile.png'.
The source code will use either \ or / for data path depending on OS during compilation. So i don't know how you are trying it. Even if it was using | symbol, wouldn't the check be made during compilation too?

There is a data folder, correct?
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 13, 2017, 04:39:07 pm
Thanks J-G for your information, but I have no idea and no solution for this..
@Lulu  -  I have now found a solution  -  well at least I now show a frame rate which is 'sensible' - anything between 70+ and 120 - didn't test too long - and I have been able to 'play' Educ'Race - finding oil-slicks and knocking motor-cyclists off the track  :D   If I were a gamer I might actually like it :)

This is after updating my video driver to handle Open GL and finally being able to install 'Blender'  - only took me a week  %) (not that I can really use it yet!).

I thought that that might also solve the issues I have with Sudoku but sadly not - that still just displays what I assume is a 'splash' screen after complaining that it can't find 'tile.png'.

Furious Paladin still complains that I don't have allegro-5.2.dll even though that is in the .exe folder, and Star Field Shooter complains about xinput1_3.dll.

Try movingdotsgl it should work now with your drivers updated.

xinput is DirectX, you need to install this:
https://www.microsoft.com/en-us/download/details.aspx?id=35

allegro should be of the same bitness of the compiled exe. if the exe is 32 bit the dll should be 32 bit. and must be of the same version. try running it from the command line to see if anything else is missing.

there is a data folder, and there is a file called tile.png, just check that.

The poll:
Currently we have 3 projects competing with 4 votes each!
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 14, 2017, 12:52:54 am
Try movingdotsgl it should work now with your drivers updated.
Sorry No - still a full white screen and an Error message
Quote from: lainz
xinput is DirectX, you need to install this:
https://www.microsoft.com/en-us/download/details.aspx?id=35
I have installed that - after some Micky$oft hassle - I don't want to be offered all kinds of MS rubbish  >:D >:D  -  fortunately I'm savvey enough to find the boxes to un-tick !!   but now it gives me an error loading ZenGL :(   so I'll give that best.
Quote from: lainz
allegro should be of the same bitness of the compiled exe. if the exe is 32 bit the dll should be 32 bit. and must be of the same version. try running it from the command line to see if anything else is missing.
No joy from the command line. I have to assume that the version (bitness) of the .dll supplied is the same as the .exe
Quote from: lainz
there is a data folder, and there is a file called tile.png, just check that.
There is now ... and it is populated with the 5 necessary files ...  so I can run Sudoku - it's a pity I can't play it :D
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 14, 2017, 01:03:46 am
I dont have a nvidia card to test. Or knowledge to see how much video card usage it does.

Too much problems revealed in this fun contest!
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 14, 2017, 11:59:36 am
I don't have a nVidia card to test. Or knowledge to see how much video card usage it does.
Too many problems revealed in this fun contest!

There are just so many 'Standards' available :)

The basic object of the contest - to improve the knowledge of participants  -  has been well served though.  I am certainly wiser.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Thaddy on August 14, 2017, 12:21:28 pm
There are just so many 'Standards' available :)
No, for the drums alone.. And I need two at least two for the voice and guitars.... Same with "other" standards....
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 14, 2017, 04:29:38 pm
OpenGL or DirectX: both failed BTW, missing libraries is just a bad readme. But crashing..
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 16, 2017, 04:47:16 pm
Furious Paladin still complains that I don't have allegro-5.2.dll even though that is in the .exe folder,

I managed to find a Win7 64-bit computer today for testing. When starting Furious Paladin, an antivirus said the program may cause harm on the computer. I simply click the allow button and it ran perfectly.

Because I am still using BGRABitmap < 9.5 I can't re-compile the latest version but at least I can now appreciate what the program does AND I can confirm that the original program does handle 8 bit  (B & W) .JPG images.

The newer version of glSlideshow will not use BGRABitmap. I found a better solution, tested, and so far it passed my tests. The 'better' I mean is easier to compile, no need to download/install any new package. Please give me some days, it has many bug fixes, minor improvements and better UI. After I make sure all of them working correctly, I will release it.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 16, 2017, 11:13:57 pm
I made the official logo (too late?) the race is almost over and the competition right now is between 2 users: bylaardt and user137, with 5 votes each one. Two games "duplo6" and "sudoku" are the most voted this year. We never had too much entries like this year, because that you can also vote your favourite like a lot of users did in the latest pages, that votes will be counted the last day.

And the last day is the question, we wait to finish this month or we can close it right now with 2 winners?
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 17, 2017, 10:49:33 pm
glSlideshow version 0.95

Features:
- Main transitions: SlideIn, Wipe, Blind, Fade, Scale, Matrix, Ribbon, Rotate
- Total 23 transitions + random
- Support .bmp, .cur, .icns, .ico, .gif, .jpeg/jpg, .png, .tif/tiff, .tga
- Low hardware requirement, only OpenGL version 1.2

Limitations:
- No full screen preview, no sound, no text support
- Cannot save project,  cannot export to avi/mpeg

Changes on version 0.95:
- New transitions: Wipe, Blind, Matrix, Random
- Some cosmetic improvements
- Let OpenGL to handle BGRA images (Thanks Akira1364)
- Better support for PNG and TIFF images (Thanks J-G)
- Replace TOpenPictureDialog with TOpenDialog
- Support more than 10000 slide count
- The form now is resizeable
- Slides can be removed and reorder
- Adjustable delay time before changing slides
- Smoother movement for slow animation
- Support 4x multisampling
- Fix thumbnail preview issue
- Fix sluggishness when animating large images

More info can be found on Readme.txt.

It now can handle graphics files better. TImage cannot fully support .bmp, .png, .tga, .tif/tiff files, so it uses FCL-Image when opening those files. Tested and passed on all the samples provided by J-G.
http://wiki.freepascal.org/fcl-image (http://wiki.freepascal.org/fcl-image)

Nothing wrong with BGRABitmap but I want more people can easily compile and test the code. FCL-Image library is included on Lazarus default installation. And I carefully chose the OpenGL commands used in the code. I have not tested but any hardware that support OpenGL version 1.2 should be able to run the program. On Windows system, you have to make sure the VGA driver is installed properly. To be able to compile this code on Linux, your computer needs libgl1-mesa-dev library installed.

It's no longer use TOpenPictureDialog when opening file, because it will crash on some 'rare' graphics file.

I haven't tested but it should be able to open more than 10k slides, because it uses TFPList as the container.

Previously, it used TTimer to slow down the animation. But the movement was noticeable ugly if the frame rate is below 20fps. Now frame rate is fixed on ± 62 fps because it now increases/decreases the total frames per slide when changing the speed.

I noticed some slow down when animating extra large images. To solve it, it will automatically scale them down to the size of user monitor's resolution.

I should mention Akira1364 has done many improvements on the code (using BGRABitmap, Advance Record, Matrix Transformation, Vertex Array). But because Vertex Array is only supported on OpenGL 3.0 or above and also I am not good on Maxtrix, so I didn't adopt them. If you're interested to see the code that using more modern version OpenGL, download here:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)

glslideshow_by_handoko
- Can it be a component for Lazarus? Maybe on OPM?

Good suggestion. I will do it, but I can't make any commitment now. If anybody have time, please do it. I have further split the UI section and graphics/animation code.

--- edit ---
Almost forget to mention, the code needs LazOpenGLContext package to compile. To enable it:
Lazarus main menu > Package > Install/Uninstall Packages > select: LazOpenGLContext 0.0.1 > click: Install Selection > Save and rebuild IDE.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 18, 2017, 10:23:12 am
Good job Handoko ! :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Pascal on August 18, 2017, 02:37:15 pm
Very impressive Handoko! 
If i could vote again i would vote for glSlideshow 8-)
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 18, 2017, 10:49:20 pm
If i could vote again i would vote for glSlideshow 8-)

A big extra large annoying "i told you"
Deadline is september 21, right?
glslideshow and educrace still evolving. Give them some time to finish. Both are nice projects.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 18, 2017, 11:20:45 pm
If i could vote again i would vote for glSlideshow 8-)

A big extra large annoying "i told you"
Deadline is september 21, right?
glslideshow and educrace still evolving. Give them some time to finish. Both are nice projects.

The deadline was September 1. Then I did it faster since no one was adding more projects. The last was in that time educrace. The voting deadline was September 21. But maybe we can do it before since a lot of users already voted and now you're the winner

And most people not voted by message. So maybe until end of month is the new deadline for voting. A month for voting is a lot.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 19, 2017, 12:29:32 am
But maybe we can do it before since a lot of users already voted
1/5 of total votes in the last 48h and one project was updated.
An early end can stop new updates.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 19, 2017, 12:33:55 am
Ok. Just end 21 Sept.

Hopefully we can get more comments with votes, and also in the poll.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on August 19, 2017, 06:31:24 pm
(Sep 21) Or (when all projects are stable) and (votes are stuck)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 19, 2017, 09:44:36 pm
But because Vertex Array is only supported on OpenGL 3.0 or above and also I am not good on Maxtrix, so I didn't adopt them.

The rendering code in my modified version uses client-side vertex arrays (meaning they exist in application memory, not GPU buffer objects, but still perform a lot better than pure immediate-mode glBegin/glEnd.) Client-side vertex arrays are not a "modern" feature at all and have been available in every version since OpenGL 1.1 (released in 1997!) I certainly could have introduced OpenGL 2.0/3.0+ style GPU-buffered arrays and shaders (which are the actual modern way of doing things), and my code was definitely designed to be easily adapted to that, but I was specifically trying not to make the hardware requirements too high. As it stands, anyone with a GPU that can run your version should also be able to run mine without issues.

Also, the TCamera advanced record I added (which uses the TMatrix advanced record internally) is a direct drop-in replacement for and reimplementation of the set of functions you had been using. All you really need to know in order to use it is:

-TCamera.LoadIdentity replaces glLoadIdentity
-TCamera.Zoom replaces glScaleF
-TCamera.Roll replaces glRotateF
-TCamera.Move replaces glTranslateF
-All of the functions have an "Upload" boolean parameter which defaults to false, but should be set to true whenever you want to send the camera's matrix to OpenGL. (For example, whenever you're doing multiple Zoom/Roll/Move operations directly one after another, only the last one needs to be uploaded as the matrix at that point is the result of all the operations combined.) 

The whole point is just that it's much faster in general to have the matrix exist application-side and do your math operations on it application-side (and only upload it to OpenGL immediately before rendering, which I used glLoadMatrixF for) than it is call the built-in matrix functions from the OpenGL library, which are typically not particularly well optimized and add quite a bit of overall "latency" to the rendering loop.

Very cool changes in your latest update, though! Looks like you've added quite a few new features. Might spend some time merging them into my version if I have the chance at some point.

Because I am still using BGRABitmap < 9.5 I can't re-compile the latest version but at least I can now appreciate what the program does AND I can confirm that the original program does handle 8 bit  (B & W) .JPG images.

Not sure what exactly you're referring to here... as far as I know Handoko never uploaded a release of the original project that included BGRABitmap as a requirement in the LPI, or used BGRABitmap at all. The zip files of my modification (that does use BGRABitmap) that I've been uploading have only included two PAS files and an LFM (meaning no particular version of BGRABitmap has ever been specified anywhere.) My initial post about it just says to "add BGRABitmap to your project requirements" to be able to compile the project with the changed files.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 20, 2017, 02:02:33 am
Because I am still using BGRABitmap < 9.5 I can't re-compile the latest version but at least I can now appreciate what the program does AND I can confirm that the original program does handle 8 bit  (B & W) .JPG images.
Not sure what exactly you're referring to here... as far as I know Handoko never uploaded a release of the original project that included BGRABitmap as a requirement in the LPI, or used BGRABitmap at all. The zip files of my modification (that does use BGRABitmap) that I've been uploading have only included two PAS files and an LFM (meaning no particular version of BGRABitmap has ever been specified anywhere.) My initial post about it just says to "add BGRABitmap to your project requirements" to be able to compile the project with the changed files.
I have tested so many 'Versions' - and still have the source code of 4 of them in my '2017 Contest' folder, re-testing to find the issue has been problematic !   I have now found the version that gave rise to my statement 'using BGRABitmap < 9.5'  -- it is Your source time-stamped at 13/8/2017 11:40 and it fails to compile with an error at line 228 of uniGraphics.pas - viz. (starting at line 210  therefore the fail line is 19 on '.width')
Code: Pascal  [Select][+][-]
  1. procedure UpdateButtonImage(Button: TBitBtn; FileName: String);
  2. var
  3.   BaseImage, ThumbNail: TBGRABitmap;
  4.   Rect: TRect;
  5. begin
  6.   BaseImage := TBGRABitmap.Create(FileName);
  7.   Rect.Left := 0;
  8.   Rect.Top := 0;
  9.   if (BaseImage.Width > BaseImage.Height) then
  10.   begin
  11.     Rect.Right := Button.Width;
  12.     Rect.Bottom := (Button.Width * BaseImage.Height) div BaseImage.Width;
  13.   end
  14.   else
  15.   begin
  16.     Rect.Bottom := Button.Height;
  17.     Rect.Right := (Button.Height * BaseImage.Width) div BaseImage.Height;
  18.   end;
  19.   Thumbnail := TBGRABitmap(BaseImage.Resample(Rect.Width, Rect.Height));
  20.   BaseImage.Free;
  21.   Button.Caption := '';
  22.   Button.Glyph.Clear;
  23.   Button.Glyph.Assign(ThumbNail.Bitmap);
  24.   ThumbNail.Free;
  25. end;


The error being 'identifier idents no member "Width"' - there is another error noted for "Height" as well - which I assumed to mean that BGRABitmap V9.5 differs from V9.2.1 by adding a 'width' and 'height' property.

Although - on reflection - in the same message window I also see many 'Hints' referring to Duplicate Unit "bgrawritepng" etc.   so that may indicate some other cause based on the number of copies I have in nested folders.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 20, 2017, 03:10:23 am
The error being 'identifier idents no member "Width"' - there is another error noted for "Height" as well - which I assumed to mean that BGRABitmap V9.5 differs from V9.2.1 by adding a 'width' and 'height' property.

I just dug up a complete BGRABitmap 7.2 source tree I had lying around on my computer (from who knows when... a long time ago, to be sure!) and I can confirm that the Width and Height properties were alive and well. Frankly I'm quite confident that they've probably always been there, since the very first version... what kind of image class would not have Width and Height? That would be insane! Haha.

So yeah, I imagine it's likely some weird bug related to duplicate files on your end, as you had suggested...

Also, you definitely don't have the most recent upload of my version... I can specifically tell as I've since made the UpdateButtonImage method a member of an "advanced record" called TSlideShowRenderer (along with all of the other image and rendering-related methods, essentially), and it starts at line 718. Would recommend re-downloading it! You can just go back to my initial post and grab the same zip file, as I was simply editing the post and swapping out the attachment as I went.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 20, 2017, 10:13:04 am
I can confirm that the Width and Height properties were alive and well. Frankly I'm quite confident that they've probably always been there, since the very first version... what kind of image class would not have Width and Height? That would be insane! Haha.
:-[  I should have thought that comment through :)
Quote from: Akira1364
Also, you definitely don't have the most recent upload of my version... I can specifically tell as I've since made the UpdateButtonImage method a member of an "advanced record" called TSlideShowRenderer (along with all of the other image and rendering-related methods, essentially), and it starts at line 718. Would recommend re-downloading it! You can just go back to my initial post and grab the same zip file, as I was simply editing the post and swapping out the attachment as I went.
Ah!  Now I remember that I had a problem looking for which post your latest version was attached to and thinking "Why not attach it to THIS post?" then being distracted by some external 'life' event and not getting back to it.

I'll have another search and create a new folder for more tests.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 20, 2017, 07:48:13 pm
Here's a direct link to my original post:

https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 12:41:45 am
Here's a direct link to my original post:
Thanks - that make life so much easier  -  well so I thought :)

I first deleted all the old files, then extracted the new  -  only to find that the 'new' .zip was only 3 files; frmMain.ifm & .pas plus uniGraphics.pas. The other 4 files were recovered from the [bin] and - - - - -  compile fails again for no identifier idents to member "width" and "height".

At least I no longer have hints about duplicates though!
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 21, 2017, 12:51:09 am
I first deleted all the old files, then extracted the new  -  only to find that the 'new' .zip was only 3 files; frmMain.ifm & .pas plus uniGraphics.pas.

That has been the case with all of the zip files I've uploaded. I've never included the entire project tree. It's always just been those three files.

Regarding your problem though.. that is extremely strange! I honestly don't think it has anything to do with BGRABitmap at all. Is it possible that the compiler is referring to the Width and Height properties of TRect, and not TBGRABitmap? What version of FPC are you using? Also, when you right-click on the TRect part of the variable declaration "Rect: TRect" (at line 722 of my most recent upload) and choose "find declaration of TRect", which file exactly are you brought to?

Additionally, what happens if you change the variable name "Rect" to "ARect"? (Make sure you change it in all the places it occurs in the overall UpdateButtonImage procedure, obviously.) This is what I would probably have called it from the outset had I originally written the method myself, as there is of course an RTL method also called Rect that returns a TRect. (And in my experience variables that have the same name as methods that are visible to the unit they're declared in are almost always bad news bears.) It's not unlikely that the naming conflict could be at least part of your issue...
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 10:20:27 am
That has been the case with all of the zip files I've uploaded. I've never included the entire project tree. It's always just been those three files.
Ah...  I've probably been confused because I've also been downloading Handoko's files as well - though keeping each in separate folders!

Quote from: Akira1364
Regarding your problem though.. that is extremely strange! I honestly don't think it has anything to do with BGRABitmap at all. Is it possible that the compiler is referring to the Width and Height properties of TRect, and not TBGRABitmap? What version of FPC are you using?
The error is flagged at line 736 :
Code: Pascal  [Select][+][-]
  1.   Thumbnail := TBGRABitmap(BaseImage.Resample(ARect.Width, ARect.Height));
Using FPC 3.0

Quote from: Akira1364
Also, when you right-click on the TRect part of the variable declaration "Rect: TRect" (at line 722 of my most recent upload) and choose "find declaration of TRect", which file exactly are you brought to?
Classesh.inc - line 28
Code: Pascal  [Select][+][-]
  1.    TRect=Types.TRect;

Quote from: Akira1364
Additionally, what happens if you change the variable name "Rect" to "ARect"? (Make sure you change it in all the places it occurs in the overall UpdateButtonImage procedure, obviously.)
As you can see from the first 'Code' extract above, did that - 9 occasions - but no change to the result.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 21, 2017, 10:23:15 am
Have you tried to delete the lib folder. I ever have weird issue happened after I combined codes from different version. It worked just weird, even I rebuilt the project. It solved after I delete the lib folder. Maybe you can try to do the same.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 10:48:01 am
Have you tried to delete the lib folder.
Yes - it went with the first clear-out.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 11:11:01 am
glSlideshow version 0.95

--- edit ---
Almost forget to mention, the code needs LazOpenGLContext package to compile. To enable it:
Lazarus main menu > Package > Install/Uninstall Packages > select: LazOpenGLContext 0.0.1 > click: Install Selection > Save and rebuild IDE.

I'm having a similar problem compiling this version as I have with Akira's 

uniGraphics.pas(108,8) Error: identifier idents no member "Height"

A total of 23 errors between lines 108 and 143 of uniGraphics.pas  ie. anywhere ther is a mention of Rect.Width or Rect.Height.
TRect again points to Types.TRect in classesh.inc as expected.

In case I had some residual code conflicts I again cleared the folder completely before downloading and extracting the .ZIP file again.

I also tested after adding the LazOpenGLContext package - just in case that solved both issues - irrespective of the lack of any logic in that action  :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: taazz on August 21, 2017, 11:30:48 am
glSlideshow version 0.95

--- edit ---
Almost forget to mention, the code needs LazOpenGLContext package to compile. To enable it:
Lazarus main menu > Package > Install/Uninstall Packages > select: LazOpenGLContext 0.0.1 > click: Install Selection > Save and rebuild IDE.

I'm having a similar problem compiling this version as I have with Akira's 

uniGraphics.pas(108,8) Error: identifier idents no member "Height"

A total of 23 errors between lines 108 and 143 of uniGraphics.pas  ie. anywhere ther is a mention of Rect.Width or Rect.Height.
TRect again points to Types.TRect in classesh.inc as expected.

In case I had some residual code conflicts I again cleared the folder completely before downloading and extracting the .ZIP file again.

I also tested after adding the LazOpenGLContext package - just in case that solved both issues - irrespective of the lack of any logic in that action  :)
Can it be a difference on fpc version? for example you are using version 3 and those are in trunk? http://forum.lazarus.freepascal.org/index.php?topic=29450.0
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 11:50:00 am
Can it be a difference on fpc version? for example you are using version 3 and those are in trunk? http://forum.lazarus.freepascal.org/index.php?topic=29450.0
The logic seems sound taazz.  I've been investigating a bit deeper - by tracing back through the definitions from Rect : TRect   ->  TRect=Types.TRect   ->   TRect = Windows.TRect   ----  eventually getting to :
Code: Pascal  [Select][+][-]
  1.      RECT = record
  2.           case Integer of
  3.              0: (Left,Top,Right,Bottom : Longint);
  4.              1: (TopLeft,BottomRight : TPoint);
  5.           end;
  6.      LPRECT = ^RECT;
  7.      _RECT = RECT;
  8.      TRECT = RECT;
  9.  
...in struct.inc

and of course there is no Height or Width mentioned!

It may well be that I will have to await the posting of a compiled binary to see the full working programs. It had occurred to me that I might try to add a 'Save Project' option to Handoko's V0.95 but that aspiration has just disappeared  :(
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 21, 2017, 02:08:48 pm
glSlideshow Version 0.96

Changes:
Nothing special, just made it compilable on some FPC/Lazarus combinations.

Hello, I made a quick fix for "cannot compile issue" (TRect related). Please test it.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 03:08:08 pm
glSlideshow Version 0.96
I made a quick fix for "cannot compile issue" (TRect related). Please test it.
Hooray!  -  successful compile  using FPC 3.0/Laz 1.6   :D 

HOWEVER  (sorry Handoko!)  -   I have a destructive streak !!   >:D 
-   Selecting images on my system at random I find some kill the program and others display 'jagged' - broken up - though I can't now find one to attach as a screen-shot.

I've put 4 on my site  -  www.crescentcomputing.co.uk/LAZ/handoko  -  for you to test on your system.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 21, 2017, 03:39:54 pm
Everything is working correctly here on my Linux64. I need more information.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 05:11:41 pm
Everything is working correctly here on my Linux64. I need more information.
That is good to know at least.

As you can see from the attached screen-shot the basic appearance is not the same as yours, in-as-much-as the [ProportionalScaling] box overwrites the [Background] button and there is no annotation on the slider bars. This screen grab was prior to [Run] of course and since the file is approaching the max allowable size, I'll post another three shots of just the view-area grabbed during a run.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 05:14:06 pm
These three images were grabbed during the run so you can see how the images are all distorted  -  on my system.

Needless to say that the images all display correctly in Photoshop/CorelDRAW! of course.

ChiAn is a very high res (4800 dpi) 8bit image (B & W)  .PNG
Crayon & Waterloo are 300 dpi RGB  .JPG
Dullcisima a 300 dpi .TIF

My main system (Win 7 Ult 64bit) is dual screen (one Portrait, one Landscape) both 1280 x 1024 and the 'problem' shows for both a 32 and 64 bit compile.

My secondary system (Win 7 Pro 32bit) single screen 1920 x 1080 shows just white rectangles  -  this is most likely the fact that the Video card on that is does not support OpenGL - -  I certainly haven't installed OpenGL drivers for it - just testing to cover all bases!
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 21, 2017, 06:34:37 pm
Thanks for reporting. I'm currently fixing a Win7 computer (I'm a computer technician), so I can test and reproduce some of the issues you mentioned.

1. The mispositioned text
My guess is CR/LF and/or right anchor issue. That is a multiline combo box with right anchoring. Linux's CR/LF is not the same as in Windows.

2. Missing annotation on slider bars
Both the slider bar are TTrackbar.

3. The thumbnails did not look good
On Linux, those thumbnail images look nicer. On Win7, the image sizes are too big, they reach the edges of the buttons.

4. Output image issue
I cannot reproduce the distorted image effects as yours. I tested the program on an old computer with integrated VGA. Most of the transitions worked well, only on some transitions they appeared totally white. I think it is reasonable because those problem transitions are using OpenGL 1.2 commands, which that VGA cannot support.

Lazarus slogan:
"write once, compile anywhere"

Sounds too easy. Yep, it really compiles on other platforms but the results can be unexpected.  :o

Some of the issues above, I believe are the widgeset bugs. Okay, I will try to fix them one-by-one. Give me some days, lets see what I can do.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 07:12:41 pm
Thanks for reporting.
You're welcome  -  it's what the Contest is about :)

Quote from: Handoko
Some of the issues above, I believe are the widgeset bugs. Okay, I will try to fix them one-by-one. Give me some days, lets see what I can do.
There's no rush as far as I'm concerned.

Another point I had meant to raise before, is that when I open your project (double click .LPI file), Laz opens but doesn't display the uniGraphics.PAS file nor the 'Form'.

To date I haven't been able to view the form (ToggleFormUnitView [F12] is greyed out) and the option to view the Source Editor just brings up an empty window  - - - unless there has been a compile error.

This means that I cannot set break points to step through the code to determine what exactly might be going on.


Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 21, 2017, 07:19:39 pm
Have you tried to use Project Inspector?

Lazarus main menu > Project > Project Inspector.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 21, 2017, 11:47:16 pm
Have you tried to use Project Inspector?

Lazarus main menu > Project > Project Inspector.
Obviously not :)   -  With my own projects I haven't needed to ferret about in the sub menus a great deal, the source is simply there.

At least I can now do a little more investigation but I still can't see the [Form] which would allow me to adjust the 'ProportionalScaling' tick box - even the Object Inspector is blank so I can't select the component and change the figures manually (rather than in the GUI).
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on August 22, 2017, 03:17:31 am
Have you tried to use Project Inspector?

Lazarus main menu > Project > Project Inspector.
Obviously not :)   -  With my own projects I haven't needed to ferret about in the sub menus a great deal, the source is simply there.

At least I can now do a little more investigation but I still can't see the [Form] which would allow me to adjust the 'ProportionalScaling' tick box - even the Object Inspector is blank so I can't select the component and change the figures manually (rather than in the GUI).

Easy. Go to Project > Forms> Form1 > open that.

Trying to use the images you provided, the error is on this line:

GraphType:
  // allocate some space
  ADst.CreateData(False);     

So basically there's no enough RAM or Video card RAM.

With other image I get this:

Win32Proc:
    // We cannot trust windows with bmWidthBytes. Use SrcLineBytes which takes
    // DWORD alignment into consideration
    with AWinBmp do
      Result := CopyImageData(bmWidth, bmHeight, SrcLineBytes, bmBitsPixel, bmBits, ARect, SrcLineOrder, ALineOrder, ALineEnd, AData, ADataSize);
    Exit;   

And with other images just the same as you, distorted.

Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 22, 2017, 11:45:16 am
Hello, I'm not a specialist in OpenGL. In my search about it, I learned that texture size are limited by video card.
You can retrieve the max texture size that the video card can support with:
Code: Pascal  [Select][+][-]
  1. var MaxTexSize: GLInt;
  2. ...
  3. glGetIntegerv(GL_MAX_TEXTURE_SIZE, @MaxTexSize);
  4.  

Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 22, 2017, 12:24:55 pm
... but I still can't see the [Form] which would allow me to adjust the 'ProportionalScaling' tick box - even the Object Inspector is blank so I can't select the component and change the figures manually (rather than in the GUI).
Easy. Go to Project > Forms> Form1 > open that.
Duh!!  There is so much more to learn once you've got past adding a component :)

Once the form is [Open] of course the object inspector is populated.
Quote from: lainz
Trying to use the images you provided, the error is on this line:

GraphType:
  // allocate some space
  ADst.CreateData(False);     

So basically there's not enough RAM or Video card RAM.
I said that I have a  >:D'destructive streak' >:D  -  since I often want to make a large (A3+) physical print of some of my photographs I do have very large files - this past week I've scanned some new 6x7 slides at 6400 dpi creating files over 600Mb  :o
The three colour files I selected at random are only 1.5, 2 and 3Mb so I'm a little surprised that they cause a 'Memory' problem.

My 9500GT card has 1Gb dedicated RAM.

I must admit that I have become somewhat cavalier over file size since the idea of more that 64Mb of RAM was inconceivable when I bought my 'Nascom' in 1980 :)  and now I'm getting by with 4Gb and 1.2Tb of Drive space. My grandson has a PC with 24Gb and 5Tb !
 
As Lulu has just posted - it might be possible to test for 'oversize' prior to display - better still at browse-selection time - and re-sample the image accordingly . . .  or post a message to say the image is too large.

Quote from: lainz
With other image I get this:

Win32Proc:
    // We cannot trust windows with bmWidthBytes. Use SrcLineBytes which takes
    // DWORD alignment into consideration
    with AWinBmp do
      Result := CopyImageData(bmWidth, bmHeight, SrcLineBytes, bmBitsPixel, bmBits, ARect, SrcLineOrder, ALineOrder, ALineEnd, AData, ADataSize);
    Exit;   

And with other images just the same as you, distorted.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on August 22, 2017, 03:17:58 pm
@ Handoko

Now I can see the code and can 'step through' I've just come across a small issue at Line 512 in frmMain :
Code: Pascal  [Select][+][-]
  1.     Button.Tag           := Int64(Slide);
When I set the target to 32bit this gives a warning :
Conversion between ordinals and pointers is not portable

changing it to Int32(Slide) removes it of course.

I don't know what effect making the change might have but it might be worth determining what the target is prior to the .Tag assignment.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 22, 2017, 06:16:15 pm
Just played around with Handoko's latest update, and initially had the same distortion/flickering/black screen issue as J-G when loading large images. I was quite certain that it wasn't a problem with my GPU (as it has 8GB vram!) and figured out pretty quickly that it's caused by the following part of TForm1.LoadImageClick (which gets called if the source image is larger than the users monitor):

Code: Pascal  [Select][+][-]
  1. with Image.Picture.Bitmap do
  2.   if (Width > Screen.Width) or (Height > Screen.Height) then
  3.     gls_ScaleDown(Screen.Width, Screen.Height, Image.Picture.Bitmap);

Scaling the actual loaded TBitmap at this point is completely unnecessary and interferes with the calculations in the (correct) OpenGL matrix scaling that happens later on in the DrawScene procedure. It's important to keep in mind that the way OpenGL renders textures has absolutely nothing to do with the size of the original source image. It's entirely dependent on the provided vertex coordinates, the provided texture coordinates, and the coordinates of the current matrix. You can load a texture with an original size of 8192 x 8192 and it will fit on the screen just fine as long as you remember to scale the matrix appropriately, based on the size of the viewport.

Comment out that part of the procedure, and you should have no problems with images of any size.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 22, 2017, 06:24:44 pm
Have to merge it with your code? I really like your code, lots of things for me to learn. I've been playing with graphics programming since I was a kid, but OpenGL is relatively new to me.

And I'm sorry with my misunderstanding that I think your code requires newer version of OpenGL to run. I searched the web about vertex array and I got the result of vertex array object, which I thought is the thing you're doing.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 22, 2017, 06:52:16 pm
I really like your code, lots of things for me to learn.

Thanks! Like I said before, the whole reason I did it in the first place was basically as a bit of an example for any users here who might be interested in learning OpenGL beyond the absolute base-level early-90's immediate mode stuff.

And I'm sorry with my misunderstanding that I think your code requires newer version of OpenGL to run. I searched the web about vertex array and I got the result of vertex array object, which I thought is the thing you're doing.

Haha, no worries. To be honest, a lot of the way things are named in OpenGL is kind of silly and not very self-explanatory, and can definitely be confusing if you're not especially familiar with it all.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 23, 2017, 09:38:45 pm
Hello :)

I made some changes on Educ'Race and now, it (normally) runs without sound if OpenAL library is not installed.
Could someone try to compile it on Linux and/or Mac please ?
You need this two package:

- BGRABitmapPack ( in BGRABitmap library->bgrabitmappack.lpk )
- LazOpenGLContext ( in Lazarus folder->components->opengl->lazopenglcontext.lpk )

Thanks to test it.

Here the link to download the source (12Mb)
www.lulutech.fr/EducRace/EducRaceSrc.7z (http://www.lulutech.fr/EducRace/EducRaceSrc.7z)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 24, 2017, 08:24:48 am
Tested on Lazarus 1.6.4 64-bit on Ubuntu Mate with GeForce 430 VGA machine and I found 4 issues.

1. OGLCScene.pas line #323 - Missing File
It can be fixed easily by typing the file name correctly. Linux is case sensitive.

2. moto.png - File Not Found
After solving issue #1, the program can be compiled successfully. But failed to start with missing texture problem. I renamed the file moto.PNG to moto.png then it started correctly.

3. Texts Issue
Most of the texts were missing their lower part, see the attachment. Some of them can be shown fully but flipped vertically.

4. Missing File
It's a minor issue, the code is still compilable without need to solve this issue. On the Project Inspector, there is a problem item marked with a red line.
Lazarus main menu > Project > Project Inspector


The audio was playing correctly. Where did you get the background music? It's nice.

---edit---
Issue 5: I just noticed, the textures of the cars are flipped vertically too.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 24, 2017, 10:17:32 am
Thanks Handoko for testing it :)

I fixed the case sensitive issues and obsolete file missing in project inspector.

On your screenshoot, sprites are vertically inverted and the color are not respected.
It seems that red green blue components are swapped, but alpha channel is keeped at the right place.
For the inverted sprite, may be there is a issue in vertex order ? I will take a look on your glSlideshow and compare with my code.

I wrote the music with Reason 3.0 for a puppet show  :D
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 24, 2017, 10:33:28 am
For the texture vertical problem, I remember Akira1364 ever said it is an issue of BGRABitmap on Linux:
http://forum.lazarus.freepascal.org/index.php/topic,35313.msg255460.html#msg255460

For the color issue, I used my own BGRAtoRGBA function. But I now use OpenGL to handle the BGRA texture:
Code: Pascal  [Select][+][-]
  1.   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Image.Width, Image.Height, 0,
  2.     GL_BGRA, GL_UNSIGNED_BYTE, Image.RawImage.Data);
You can see the parameter GL_RGBA and GL_BGRA
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 24, 2017, 12:05:34 pm
For the texture vertical problem, I remember Akira1364 ever said it is an issue of BGRABitmap on Linux:
http://forum.lazarus.freepascal.org/index.php/topic,35313.msg255460.html#msg255460

For the color issue, I used my own BGRAtoRGBA function. But I now use OpenGL to handle the BGRA texture:
Code: Pascal  [Select][+][-]
  1.   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Image.Width, Image.Height, 0,
  2.     GL_BGRA, GL_UNSIGNED_BYTE, Image.RawImage.Data);
You can see the parameter GL_RGBA and GL_BGRA

For colors, I follow your code and it work well ! :)

And for inverted sprites issue, before creating OpenGL texture, I added a compilation directive like:
Code: Pascal  [Select][+][-]
  1. function TTextureManager.InitFromBGRABitmap(aIma: TBGRABitmap ): PTexture;
  2. var temp, dup:TBGRABitmap;
  3. begin
  4.  dup := aIma.Duplicate as TBGRABitmap;
  5. {$IFNDEF WINDOWS}
  6.  dup.VerticalFlip;
  7. {$ENDIF}
  8. ...
  9.  

Here the new version
www.lulutech.fr/EducRace/EducRaceSrc.7z (http://www.lulutech.fr/EducRace/EducRaceSrc.7z)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 24, 2017, 01:46:43 pm
I found 2 bugs:

1. oglcSurfaceImplementation.inc line #2412 - Syntax Error
The compiler reports error on line #2412, actually the bug is on line #2406. You should move the "const" to inside the $IFDEF block. The correct code should be:
Code: Pascal  [Select][+][-]
  1.  {$IFDEF WINDOWS}
  2. const
  3.   FLIP_TEXCOORD : array[ 0..3 ] of TTextureCoordIndex = ( ( 0, 1, 2, 3 ), ( 1, 0, 3, 2 ), ( 3, 2, 1, 0 ), ( 2, 3, 0, 1 ) );//( ( 3, 2, 1, 0 ), ( 2, 3, 0, 1 ), ( 0, 1, 2, 3 ), ( 1, 0, 3, 2 ) );
  4.  {$ELSE}
  5.  
  6.  {$ENDIF}

2. oglcSurfaceImplementation.inc line #2455 - Identifier Not Found
For this one, I have no idea.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 24, 2017, 02:02:09 pm
Oh, I'm sorry, reading your publication where you talk about Akira, I started a method to avoid the image of inverted sprites then I forgot my first idea and left to rewrite another part of my code ... :-[

Simply remove the IFDEF WINDOWS, ELSE and ENDIF lines and keep only
Code: Pascal  [Select][+][-]
  1. const
  2.   FLIP_TEXCOORD : array[ 0..3 ] of TTextureCoordIndex = ( ( 0, 1, 2, 3 ), ( 1, 0, 3, 2 ), ( 3, 2, 1, 0 ), ( 2, 3, 0, 1 ) );//( ( 3, 2, 1, 0 ), ( 2, 3, 0, 1 ), ( 0, 1, 2, 3 ), ( 1, 0, 3, 2 ) );
  3.  
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 24, 2017, 09:41:38 pm
@Handoko, I made some test with glSlideshow with PNG image


1) 1024x768 image : no problem, all work perfectly

2) same image resized to 4096x4096 : application crash. I commented
Code: Pascal  [Select][+][-]
  1. //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Image.Width, Image.Height, 0,
  2.     //GL_BGRA, GL_UNSIGNED_BYTE, Image.RawImage.Data);
in unit uniGraphics, line 290/291 -> Nothing is drawn of course, but application don't crash.

3) same image resized 4096x4096 : I uncommented lines above, then I commented lines 325/327 in unit frmMain
Code: Pascal  [Select][+][-]
  1.   // Resize the image if it's larger than screen size
  2. //  with Image.Picture.Bitmap do
  3. //    if (Width > Screen.Width) or (Height > Screen.Height) then
  4. //      gls_ScaleDown(Screen.Width, Screen.Height, Image.Picture.Bitmap);
  5.  
No crash and image is drawn and move according the transition selected, but it's slow due to 4096x4096 pixels image.

Maybe it's a relationship to the fact that video cards only accept texture sizes in power of 2? But I don't know if this is a rules for all cards or only some of them.

In the framework for educ'race game, i use the following function to compute the new size of an image to resize it in power of 2. I tryed it with the 4096x4096 png image and it work.
Code: Pascal  [Select][+][-]
  1. function TTextureManager.ValueOfNextPowerOfTwo(aValue: integer): integer;
  2. begin
  3.  Result :=1;
  4.  while ( power (2,Result)<aValue ) do inc ( Result );
  5.  Result := trunc(power (2,Result));
  6. end;
  7. ...
  8. dup := TBGRABitmap.Create('xxxxx.png');
  9. temp := TBGRABitmap.Create( ValueOfNextPowerOfTwo(dup.Width),ValueOfNextPowerOfTwo(dup.Height),BGRAPixelTransparent );
  10. temp.PutImage ( 0, 0, dup, dmSet);
  11. ...
  12.  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, temp.Width , temp.Height, 0, GL_BGRA, GL_UNSIGNED_BYTE, temp.Data );
  13.  
  14.  
Note, in glTexImage2D call I now use 'GL_BGRA' as you advised me :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 26, 2017, 03:02:09 am
Finished up an initial attempt at merging the features from Handoko's latest version of glSlideShow into my modified take. See my original post for more details and a link to the new zip file:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)
It includes pretty much everything except for the re-ordering/remove popup menu. I also added TSplitters so you can freely resize the TOpenGLControl within the form.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 26, 2017, 02:31:49 pm
Thanks Akira, that code will be very useful for me and others who want to learn OpenGL.

But I have problem compiling your code. It said it fails to find BGRABitmapTypes unit. I checked my Online Package Manager and I can see BGRABitmap dan BGRAControl installed.

What should I do next?
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on August 26, 2017, 04:08:02 pm
I have solved the BGRABitmapTypes issue. Because Akira1364 didn't provide the project information files, I copy from mine. But I forgot to add BGRABitmapPack as the project requirement.

But now, I get new error when compiling.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 26, 2017, 09:18:52 pm
Because Akira1364 didn't provide the project information files, I copy from mine.

I've only been including the two PAS files and the LFM as I thought it would be easier for people to just make a copy of their existing project folder and drop the three files into it (replacing the ones that are already there, obviously) and then simply add BGRABitmap to the requirements of the existing LPI. 

But now, I get new error when compiling.

Woops! I just forgot to take off the decimal places so that the TimerInterval variable will work as both an Int64 or a Double depending on the platform, and didn't notice as on Windows the code compiles fine since in that case it actually is a floating point type.

Extremely simple fix, literally all you need to do is remove the ".0" at the end of each line in the case statement..... I replaced the zip file again with this change, as well.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 28, 2017, 10:59:16 am
@Akira: I learned some good things with your code, thanks ! :)
About converting image size in power of 2: Do you think it's not necessary ?
I found this link that discuss on this topic: https://www.khronos.org/opengl/wiki/NPOT_Texture (https://www.khronos.org/opengl/wiki/NPOT_Texture)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on August 28, 2017, 05:15:34 pm
@Akira: I learned some good things with your code, thanks ! :)

Cool! Good to hear.

About converting image size in power of 2: Do you think it's not necessary ?

Well, what it boils down to is that NPOT textures have been supported on all GPUs released since roughly mid-2004. So the only users it could possibly matter for in the first place are those running pre-2004 GPUs. Frankly I imagine that the number of people who fit into that demographic is likely close to zero nowadays.

That being said, the "distorted images" issue in Handoko's code was not actually related at all to NPOT textures (if it was, it wouldn't have affected you unless you're one of the people running very old hardware. It also happened no matter what, regardless of whether or not the texture was actually NPOT.) It was caused by the fact that he was resizing the actual TBitmap images based on the size of the screen, and not the size of the OpenGL viewport, and thus when he called "glCopyTexImage2D" with viewport coordinates the pixels being read only made up a small portion of the image.

As you noted yourself, once the section of the code that resized the TBitmap was commented out, everything worked fine because all resizing was then only being done "virtually", by scaling the current OpenGL matrix (which is the correct way to do things.)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Lulu on August 28, 2017, 07:48:48 pm
Thanks you again Akira for your clarifications. I feel I'm stuck on OpenGL knowledge of the last century !  :D
I will study your code more thoroughly
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 03, 2017, 03:06:05 am
Just uploaded a new copy of the zipfile for my version of glSlideShow... can be found in my original post, as always, which I'll link here again:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)

It now has all of the same right-click popup-menu-based slide reordering and removal functionality that Handoko's last update did. More interestingly/importantly, I also implemented the ability to save and load your slide/transition lineups to and from file, which Handoko had said was an intended feature. This is accessed through a standard "File" menu at the top of the form. Apart from that, I reworked the way I implemented some of the transitions a little bit as I realized I had caused weird scaling problems in certain edge cases.

Would be interested to hear how it works for everyone! (Especially if you're on Linux... I did my best to write everything cross-platform, but have not actually ran the application on anything other than 64-bit Windows 10.)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 03, 2017, 03:30:47 am
Thank you Akira. I saved the file and will learn it properly when I am not busy.

But I'm curious why you used TSplitter for the resizing, why no directly resize it on FormResize?
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on September 03, 2017, 03:42:12 am
Hi, well seems that the votes reached the limit of 27, that's a lot. So I locked the poll, and according to the number of votes I created the list of winners.

Winners:
1° "duplo6" by bylaardt
2° "relogio" by bylaardt and "sudoku" by user137
3° "furiouspaladin" by handoko

About the votes by forum message reply: I think each participant received his feedback in the comments.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 03, 2017, 03:58:56 am
Thank you Akira. I saved the file and will learn it properly when I am not busy.

But I'm curious why you used TSplitter for the resizing, why no directly resize it on FormResize?

Not sure what you mean. Having TSplitters on the right and bottom side of the TPanel that the TOpenGLControl is sitting in allows the user to freely resize it to absolutely any width and height that they might want within the form. "Doing it in FormResize" would mean I would be doing some kind of rough arbitrary calculation based on what I think the width and height should be set to based on the size of the form.

Hi, well seems that the votes reached the limit of 27

lol the maximum number of votes a forum poll can have is specifically 27? Why?
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 03, 2017, 11:01:03 am
Hi, well seems that the votes reached the limit of 27
lol the maximum number of votes a forum poll can have is specifically 27? Why?

 :D  I suspect that this is a case of many nations divided by a common language  :D

I have the advantage of being a native English speaker and sometimes have to re-read comments to appreciate the real meaning of what is said and I am always aware that your (anyone!!) use of English is vastly superior to my use of your native language!

I think lainz was saying "It seems unlikely that we will get any more than the 27 votes already cast, so I'll close the poll" rather than "There is a limit of 27 votes on any poll"
Title: Re: Graphics Contest 2017, please vote now!
Post by: Thaddy on September 03, 2017, 12:20:52 pm
Hm #27 is the ESC key.... :-* O:-) :D
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on September 03, 2017, 02:56:55 pm
I think lainz was saying "It seems unlikely that we will get any more than the 27 votes already cast, so I'll close the poll" rather than "There is a limit of 27 votes on any poll"

That's it. I don't know if in Spanish it makes sense :D It's just my speech.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 03, 2017, 03:32:22 pm
I think lainz was saying "It seems unlikely that we will get any more than the 27 votes already cast, so I'll close the poll" rather than "There is a limit of 27 votes on any poll"
That's it. I don't know if in Spanish it makes sense :D It's just my speech.

Google tells me that would be "Parece poco probable que obtengamos más de los 27 votos ya emitidos, así que cerraré la encuesta"

.. but I have no idea if that is anything like you would actually use in everyday speech  :D
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 03, 2017, 03:59:54 pm
I think lainz was saying "It seems unlikely that we will get any more than the 27 votes already cast, so I'll close the poll" rather than "There is a limit of 27 votes on any poll"

Well yeah, I was quite certain there was no way the limit was actually 27. Just figured I'd make a joke about it rather than directly question what he meant.... Native English speaker here as well, by the way.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on September 03, 2017, 04:01:26 pm
I think lainz was saying "It seems unlikely that we will get any more than the 27 votes already cast, so I'll close the poll" rather than "There is a limit of 27 votes on any poll"

Well yeah, I was quite certain there was no way the limit was actually 27. Just figured I'd make a joke about it rather than directly question what he meant.... Native English speaker here as well, by the way.

Thanks for the joke, really I need to practice or read what I write twice :D

I think lainz was saying "It seems unlikely that we will get any more than the 27 votes already cast, so I'll close the poll" rather than "There is a limit of 27 votes on any poll"
That's it. I don't know if in Spanish it makes sense :D It's just my speech.

Google tells me that would be "Parece poco probable que obtengamos más de los 27 votos ya emitidos, así que cerraré la encuesta"

.. but I have no idea if that is anything like you would actually use in everyday speech  :D

Another misunderstanding, I was talking about my original sentence (missing new line?), that indeed it has no correct sense. In the other hand your sentence is perfect in both languages.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 03, 2017, 05:33:44 pm
Yikes! The zip file I uploaded yesterday had a slightly old copy of "frmMain.pas" with a not-quite-complete version of the procedure that loads slideshow lineups from file. I just switched it out for a copy that contains the up-to-date version. Please re-download, if you already have. A link to the post, again:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 03, 2017, 06:34:17 pm
Thanks for informing us. Downloaded and saved it in my 'must study' folder.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 03, 2017, 08:02:38 pm
No problem!

Has anyone not using Windows actually built and run it yet? Just asking as I think everything should work properly on other platforms, but I'm not 100% sure as I don't have access to any non-Windows machines with Lazarus right now that I could use to test it.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Leledumbo on September 03, 2017, 09:46:28 pm
Has anyone not using Windows actually built and run it yet? Just asking as I think everything should work properly on other platforms, but I'm not 100% sure as I don't have access to any non-Windows machines with Lazarus right now that I could use to test it.
Builds fine (requires enough experience building complete project with dependencies from just unit files, though, not really friendly), but upon running I got:
Code: [Select]
X Error: BadValue (integer parameter out of range for operation) 2
  Extension:    155 (Uknown extension)
  Minor opcode: 3 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
so the OpenGLContext canvas doesn't load. Tried running using primusrun (this is an optimus laptop), I got:
Code: [Select]
primus: warning: glXSwapBuffers: no current context
but at least the canvas turns black.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 03, 2017, 11:14:46 pm
Builds fine (requires enough experience building complete project with dependencies from just unit files, though, not really friendly), but upon running I got:
Code: [Select]
X Error: BadValue (integer parameter out of range for operation) 2
  Extension:    155 (Uknown extension)
  Minor opcode: 3 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
X Error: GLXBadContext 169
  Extension:    155 (Uknown extension)
  Minor opcode: 5 (Unknown request)
  Resource id:  0x5400018
X Error: 0 0
  Extension:    155 (Uknown extension)
  Minor opcode: 26 (Unknown request)
  Resource id:  0x0
so the OpenGLContext canvas doesn't load. Tried running using primusrun (this is an optimus laptop), I got:
Code: [Select]
primus: warning: glXSwapBuffers: no current context
but at least the canvas turns black.

What Linux distro and widgetset are you using, exactly? I know Handoko has previously been able to run my version on what appeared to be the GTK2 widgetset, although I'm not sure what variety of Linux he was on. Are you able to pinpoint the line of code it specifically fails at via debugging? Also, are the error messages you posted actually fatal? (As in you literally had to immediately close the application after getting them.) If not, what happens when you attempt to go ahead and load images/play the slideshow? Lastly, are you able to run Handoko's last update of the project without issues? As I've said before, I haven't used any GL extensions that came out any later than 1997/1998 or so, so there should be no real difference in hardware requirements between his version and mine.

As far as not including the project files, my intention was for people to simply make a copy of an existing glSlideShow project folder (most likely the original one, assuming they had already downloaded it) and drop my changed files into it and just add BGRABitmap to the requirements. No one seems to find that as obvious as I thought it was though, so I might just start including the LPI and LPR.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on September 04, 2017, 12:00:36 am
What Linux distro and widgetset are you using, exactly? I know Handoko has previously been able to run my version on what appeared to be GTK2, although I'm not sure what variety of Linux he was using. Are you able to pinpoint at what line of the code it specifically fails via debugging?
work fine on gtk2.
qt = black/transparent canvas. 

Winners:
1° "duplo6" by bylaardt
2° "relogio" by bylaardt and "sudoku" by user137
3° "furiouspaladin" by handoko

About the votes by forum message reply: I think each participant received his feedback in the comments.
First cheat in Double6 game: early closure of this contest. :-[

Special thanks to Circular et al. by the excellent work in the bgrabitmap library used in the double6, clock and steampunkclock.

My vote was not computed in the poll because I was expecting the final version of the slideshow. I have not decided yet between slideshow and sudoku.

About the reviews:
I had learn a lot with you guys, especialy about code organization (yep, my codes are a mess - i admit)
I really appreciate each projects here, except one, but i will'nt say wich is, because raw may don't like this (oops!).
Sometimes you don't need a solution: you just need a little inspiration to do something great, and here you can get a lot of good things.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 04, 2017, 12:08:12 am
work fine on gtk2.
qt = black/transparent canvas. 

Thanks! That's quite helpful. I'll take a look at how the QT version of TOpenGLControl is implemented, and also at how BGRABitmap loads images under QT. 

Edit: Just to be sure, I'm assuming you're talking about QT4? As the QT5 widgetset is as far as I know still in something of a "work in progress" status... Also, can anyone confirm whether or not TOpenGLControl does "generally" function properly under QT to begin with in most situations? That would be a good starting point! Haha.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Leledumbo on September 04, 2017, 02:53:18 am
What Linux distro and widgetset are you using, exactly? I know Handoko has previously been able to run my version on what appeared to be the GTK2 widgetset, although I'm not sure what variety of Linux he was on.
BINGO! Qt seems to have problem ATM (probably because Manjaro has bleeding edge Qt5), but GTK2 is unaffected. Now the problem is just during the transition images are upside down, but in correct position when done.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 04, 2017, 03:10:50 am
What Linux distro and widgetset are you using, exactly? I know Handoko has previously been able to run my version on what appeared to be the GTK2 widgetset, although I'm not sure what variety of Linux he was on.
BINGO! Qt seems to have problem ATM (probably because Manjaro has bleeding edge Qt5), but GTK2 is unaffected. Now the problem is just during the transition images are upside down, but in correct position when done.

Sounds like there's some more texture/vertex coordinates I need to add conditional IFDEFS for somewhere, then. (This is to account for the fact that BGRABitmap flips images and reorders their color layout internally by default when loading them on GTK2, meaning the coordinates required to make them look correct are the opposite of the ones that look correct on Windows. Thought I had covered all of them, apparently not!)

Does this happen with all transitions, or just some? And is the issue only that they're upside down? Handoko had stated that the actual colors in the loaded textures appeared incorrectly for him before, so I'd like to confirm that I did fix that properly as well... Also, are you able to tell me whether or not the functionality I added that saves and loads slideshow lineups to and from text files works properly for you? Just want to be sure that there aren't any directory/filename/e.t.c issues on Linux.

Lastly, on a more general note, I went ahead and uploaded a new zip file that includes the necessary LPI and LPR to just open the project and compile it right away, since that seems to be what everyone would prefer. Here's a link to where you can find it, again:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 04, 2017, 05:19:28 am
Just downloaded and tested using Lazarus 1.6.4 Gtk2 64-bit on Ubuntu Mate 16.10. And I found some issues:

- Program crash when loading some rare image formats
On my previous post, I already mentioned the culprit is TOpenPictureDialog, it does not fully support some image formats. My solution was not use it but use TOpenDialog instead.

- The user interface looked weird
This issue already reported by J-G (for glSlideshow). I believe it is widgetset issue, so far I still have no solution.

- Matrix transitions did not work correctly
Both Matrix Drop and Matrix Dissolve transitions do not work correctly.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 04, 2017, 05:35:01 am
- Program crash when loading some rare image formats

Which image formats specifically did you have problems with?

- The user interface looked weird

How so?

- Matrix transitions did not work correctly

Is this related to what Leledumbo mentioned above (upside down, e.t.c?) If not, what exactly doesn't work with them? Screenshots would help a lot if you have time to take them, as from there I can figure out which coordinates I need to IFDEF much faster... Also, did you try the saving/loading slideshow lineups feature? If you did, did it work for you?


Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 04, 2017, 06:39:03 am
- Program crash when loading some rare image formats

Which image formats specifically did you have problems with?

Lulu J-G has a collection of 'rare' pictures that can cause TOpenPictureDialog to crash. :D
But he has deleted them from his website.

The program does not always crash and I cannot sure to reproduce it. What I know are they are *.tif files, put them into a folder, and the program often crash or exit immediately without error/warning when using TOpenPictureDialog browsing to that folder. My guess is, it fails to generate preview on the dialog. The strange is, if I test the image one-by-one, all of them are okay. It solved in my glSlideshow by avoiding to use TOpenPictureDialog and TIFF image loading is handled by FCL-Image unit.


How so?

Not serious problem just some cosmetic issues, please see the attachment. The text "Use Proportional", the screen update when dragging the slider, and don't know why there is darker/lighter color.

- Matrix transitions did not work correctly

Same as what Leledumbo said.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 04, 2017, 07:16:47 am
The program does not always crash and I cannot sure to reproduce it. What I know are they are *.tif files, put them into a folder, and the program often crash or exit immediately without error/warning when using TOpenPictureDialog browsing to that folder. My guess is, it fails to generate preview on the dialog. The strange is, if I test the image one-by-one, all of them are okay. It solved in my glSlideshow by avoiding to use TOpenPictureDialog and TIFF image loading is handled by FCL-Image unit.

Sounds like a GTK2-specific issue with the previews in TOpenPictureDialog. I have no problems of any kind with TIFF files on Windows... BGRABitmap can load them just fine.

Not serious problem just some cosmetic issues, please see the attachment. The text "Use Proportional", the screen update when dragging the slider, and don't know why there is darker/lighter color.

Weird! Again, this seems like a GTK2 issue that isn't really directly related to the application or solvable within the scope of it... Will see if I can find any kind of workaround though.

As far as the Matrix transitions go, I'm pretty sure it probably has something to do with the pixel format of the textures being filled with glCopyTexImage2D not being the same as the pixel format of textures that were loaded from file (since on GTK2 BGRABitmap reorders the bits of images by default.) Shouldn't be too difficult to fix, so I'll see what I can do! Thanks for the input about everything.

Edit: I'd still like to know whether or not the saving and loading of slideshow lineups to and from text configuration files works properly on Linux. Can anyone confirm this?
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 04, 2017, 06:19:24 pm
I tested the saving/loading feature, basically it works. But if it failed to loading a an image (in my test it was *.icns), the saving does not work correctly.

I saw you use .cfg as the file extension, but it won't automatically added to the file name. I have to type it manually or rename the file after saving.

Your version of glSlideshow cannot load *.icns images. Mine (using Image.Picture.LoadFromFile) works without problem.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 04, 2017, 06:50:04 pm
I saw you use .cfg as the file extension, but it won't automatically added to the file name. I have to type it manually or rename the file after saving.

That's strange, as it's the only extension registered to the Filter property of the TSaveDialog, so it should be definitely be added automatically. Unless the Filter property of TSaveDialog just doesn't actually do anything on GTK2. Are the extensions normally added properly when saving files, in other applications? If not, I can definitely make it so that it's added manually by the application when not running on Windows.

Good to know the procedures generally work, though. I wasn't entirely sure if there were any breaking differences with the way things like FileExist work on Linux, and it seems like there isn't.

Your version of glSlideshow cannot load *.icns images. Mine (using Image.Picture.LoadFromFile) works without problem.

Isn't that the Mac OSX icon file format? Have honestly never tried to load one until just now, but you're right! BGRABitmap normally seems to fall back to the "native" image loading routines for formats that it doesn't directly handle, but I guess ICNS got missed. I should be able to add support for them pretty easily though, will add it to my todo list.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 04, 2017, 07:03:54 pm
We found many issues related with BGRABitmap and you solved them, like the the flipped OpenGL texture. So I think you should submit a bug report to BGRABitmap developer too.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 04, 2017, 07:49:30 pm
We found many issues related with BGRABitmap and you solved them, like the the flipped OpenGL texture. So I think you should submit a bug report to BGRABitmap developer too.

The behaviour of BGRABitmap is entirely correct, actually, as far as its intended use as a normal image library. If it didn't automatically change images to RGBA format on GTK2, they would be upside down with inverted colors in all situations (not just OpenGL applications), because the format of the operating-system-level GTK2 "Pixbuf" is RGBA. The default format used by OpenGL contexts is also RGBA.

However, the operating system pixel format on Windows is BGRA (which is why BGRABitmap doesn't do any flipping on Windows), which of course to OpenGL is technically upside down. So essentially, there is no way to write an OpenGL application that looks correct on all platforms and completely avoids flipping images or submitting different sets of texture coordinates. It's not really an "issue" in any sense overall though, just the reality of cross-platform development.

Also, I'm still curious as to whether TSaveDialog normally adds the Filter extension automatically when saving files on GTK2, in other applications. Kind of strange if it doesn't as that makes the Filter property essentially useless, although it's not really a big deal. Like I said, I could easily make it so that it's added by the application when necessary.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 04, 2017, 08:07:10 pm
But how do you explain why the flipping image issue doesn't happen on my case?

I had the BGRA-RGBA issue, so I wrote my own function. But later, I saw your code and knew that BGRA is supported by OpenGL. I read and learned from Wikipedia that BGRA has been supported since OpenGL version 1.2. So I abandoned my BGRAtoRGBA function and use OpenGL internal support instead. The result works on both Linux and Windows without need to use $IFDEF.

Also I never have flipping texture issue. Actually I had but those was my calculation/coding error, not platform related issue.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 05, 2017, 11:17:46 pm
It's because your version just treats everything homogeneously as BGRA even when it's not the native application pixel format (as in, on GTK2.) As I said, BGRABitmap correctly automatically swaps the color layout and lineorder of images on GTK2 because it's what that widgetset (and more broadly what almost all Linux GUI "servers") uses internally.
 
This is actually something of an advantage for Linux in the case of OpenGL applications, because again the internal color format OpenGL uses is also RGBA, which makes calls to methods like glTexImage2D faster due to the fact that the pixels are already laid out in the manner OpenGL wants. Windows OpenGL drivers are on other hand typically optimized to expect the "reverse" (relative to OpenGL) BGRA format, meaning on Windows BGRA is generally the right way to go since it's also the native operating system format in that case.

So perhaps I should clarify that what I really meant is "there's no way to write a cross-platform OpenGL application that performs equally well on all of the platforms while also completely avoiding things like flipping images or submitting different sets of texture coordinates."

Your version is actually specifically optimized for Windows (not even the platform you use!), whereas the conditional complication in mine (which honestly only takes maybe 15 seconds to implement in most cases) allows for the "best" options to be chosen no matter what it's running under.

Edit:
Just uploaded a new file that includes the support for ICNS and should no longer have the upside-down problem with the two matrix dissolves. Again, you can find it here...
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 06, 2017, 10:25:19 am
I've been busy with other projects over the past few days and the code for glSlideShow seemed to be in a state of flux so I haven't tested each of Akira's revisions - though I have downloaded each.

Today I've made a little time, tried to compile the latest version and have to report errors :

Code: Pascal  [Select][+][-]
  1. Compile Project, Mode: Release, Target: glSlideshow.exe: Exit code 1, Errors: 8
  2. frmMain.pas(233,108) Error: Illegal qualifier
  3. frmMain.pas(243,18) Error: Identifier not found "TStringArray"
  4. frmMain.pas(243,30) Error: Error in type definition
  5. frmMain.pas(283,42) Error: Illegal qualifier
  6. frmMain.pas(284,20) Error: Type mismatch
  7. frmMain.pas(288,42) Error: Illegal qualifier
  8. frmMain.pas(292,39) Error: Illegal qualifier
  9. frmMain.pas(301,83) Error: Illegal qualifier

I've ignored the 3 'Warnings'

These errors may be down to me not upgrading BGRABitmap to V9.5 of course - - - maybe that's the next thing I need to do :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 06, 2017, 10:47:30 am
I just downloaded and tested Akira's code. I have no problem compiling the code. I currently have BGRABitmap 9.5.0.0 installed. I installed BGRABitmap using Online Package Manager. Very easy and useful, you should try it. I believe you will fall in 'love' with it too.
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on September 06, 2017, 03:05:58 pm
What kind of future do we want for this contest then. Next time something with a theme or ready assets, or perhaps just some sort of showcase thread that we would just use to show what Lazarus can do? I'm not sure on the latter, anyone can really make new threads if they have such projects, but maybe it would motivate.

On theme part, it could be something as simple as "Make the fanciest triangle on the screen you can do.". It could be animated or not, but there could be a rule that everything has to be programmatically generated, using no external picture files or pre-saved buffers like TImage. Of course in such contest the code complexity should be taken into account when rating. It's simple to make a lighted and colored rotating triangle with OpenGL, but reflected and pixel shaded on a wobbly water surface.. is something worlds harder to do.
Title: Re: Graphics Contest 2017, please vote now!
Post by: bylaardt on September 06, 2017, 03:21:22 pm
maybe a opengl contest?
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 06, 2017, 03:48:22 pm
I just downloaded and tested Akira's code. I have no problem compiling the code. I currently have BGRABitmap 9.5.0.0 installed.

I've now updated to 9.5 but still have the same 8 errors and 3 warnings.


Quote from: Handoko
I installed BGRABitmap using Online Package Manager. Very easy and useful, you should try it. I believe you will fall in 'love' with it too.
Yes OPM is easy and useful  -  my emotions are not that easily stirred  :D
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 06, 2017, 04:23:36 pm
I've now updated to 9.5 but still have the same 8 errors and 3 warnings.

Just like the last issue you had, this one definitely has zero to do with BGRABitmap or any other package... not sure why that's your first assumption? TStringArray is nothing more than an alias for "array of string", defined in "syshelph.inc". So presumably your FPC installation has a version of that file that predates the introduction of the type.

That being said, literally all you should need to do to fix it is:

At line 243 of frmMain.pas, change it from this:

Code: Pascal  [Select][+][-]
  1. SeparatedLine: TStringArray;

to this:

Code: Pascal  [Select][+][-]
  1. SeparatedLine: array of String;

Edit: I'd also still like clarification on whether or not the GTK2 version of TSaveDialog is actually supposed to automatically append the filter extensions to filenames in the manner the Windows implementation does... anyone?
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 06, 2017, 06:20:02 pm
I've now updated to 9.5 but still have the same 8 errors and 3 warnings.
Just like the last issue you had, this one definitely has zero to do with BGRABitmap or any other package... not sure why that's your first assumption?
I'm not sure if it was lainz or handoko that first suggested that it might be the V9.2.1 versus V 9.5 issue - I just took that suggestion on board. I could well be the fact that I'm using Laz 1.6.0 and FPC 3.0.0  but I would have thought that since they are still the latest 'stable' versions they ought to be supported.
Perhaps it would help understanding if I mentioned that I'm just reporting what I find as I spend a few minutes checking the forum while I'm busy with other 'life' issues rather than evaluating the code trying to understand what's going on :)

Quote from: Akira1364
TStringArray is nothing more than an alias for "array of string", defined in "syshelph.inc". So presumably your FPC installation has a version of that file that predates the introduction of the type.

That being said, literally all you should need to do to fix it is:

At line 243 of frmMain.pas, change it from this:

Code: Pascal  [Select][+][-]
  1. SeparatedLine: TStringArray;

to this:

Code: Pascal  [Select][+][-]
  1. SeparatedLine: array of String;

Done that, and yes, 6 of the 8 errors are gone along with the 3 warnings, leaving line 233 pos 108  ---  '.ToString'  with is not a component of '.Box.ItemIndex' apparently - and line 283 pos 42 ---  '.Split([',']' not being a component of 'LoadList.Strings[ I ]'.

Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 06, 2017, 09:17:39 pm
Done that, and yes, 6 of the 8 errors are gone along with the 3 warnings, leaving line 233 pos 108  ---  '.ToString'  with is not a component of '.Box.ItemIndex' apparently - and line 283 pos 42 ---  '.Split([',']' not being a component of 'LoadList.Strings[ I ]'.

Strange. That's again related directly to the syshelph.inc file. It seems like the compiler isn't recognizing the string helper type, for some reason (which as far as I know should be perfectly functional in FPC 3.0.0)..

You could first simply try adding

Code: Pascal  [Select][+][-]
  1. {$modeswitch TypeHelpers}

at the top of the form underneath the mode ObjFPC declaration, and see if that helps. If that doesn't work, try putting SysUtils at the very end of the list of "uses". (As well as at the very beginning, perhaps.)
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 06, 2017, 09:35:02 pm
Thanks Akira,  I've tried all those suggestions but still get the 2 errors. Just in case I've mis-understood your excellent instructions, here is the new heading to frmMain :

Code: Pascal  [Select][+][-]
  1. unit frmMain;
  2.  
  3. {$mode objfpc}{$H+}
  4. {$modeswitch TypeHelpers}
  5.  
  6. interface
  7.  
  8. uses
  9.   SysUtils,
  10.   {$IFDEF WINDOWS}
  11.   Windows,
  12.   {$ELSE}
  13.   LCLIntf,
  14.   {$ENDIF}
  15.   Classes, Forms, Controls, Graphics,
  16.   Dialogs, Buttons, StdCtrls, ComCtrls,
  17.   ExtDlgs, ExtCtrls, Menus, BGRABitmapTypes,
  18.   BGRABitmap, GL, OpenGLContext, uniGraphics,
  19.   SysUtils;
  20.  

I also tried with SysUtils only at the end.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 06, 2017, 11:54:48 pm
Well, the code you've posted there wouldn't compile as it includes SysUtils twice. What I meant was try it at the very beginning and very end separately.

Edit: Just took a look, it seems the RTL type helpers were introduced in 3.0.2, so they're simply not going to exist in your sources. I'll see if I can throw together some alternate implementations that don't use them for the relevant methods... although I would also suggest you consider moving up to at least 3.0.2 generally, as there's quite a few benefits/useful additions.

Edit 2: Ok, just uploaded a new set of project files. There's now conditionally-compiled non-type-helper implementations of the string handling stuff for FPC versions less than 3.0.2. Here's the link:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 07, 2017, 11:45:10 am
Success !!  
Well  -  I've compiled it and haven't (yet) broken it with 6 images :)

I did have to apply the previous corrections (ModeSwitch & Array of String) but that was no real surprise.

A small niggle - using 'ribbon' (any direction) on the first image, there are two copies of the image in the ribbon and the second one moves forward.

Testing with a 40Mb CMYK  .TIF  (3780 x 5551 px), it never manages to show the thumbnail (after a two minute wait). An 80Mb .PNG (RGB) (8297 x 5290 px) image shows the thumbnail but the main image is blank.

Well, the code you've posted there wouldn't compile as it includes SysUtils twice. What I meant was try it at the very beginning and very end separately.
That was my original thought but your instruction "(As well as at the very beginning, perhaps.)"   I interpreted literally but now appreciate that you meant "OR at the very beginning"
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 07, 2017, 03:24:32 pm
I've now tested a number of large images and whilst none of them 'crash' the program, they either don't load as a thumbnail or are blank in the main window.

If anyone wants to test them on their system I've put a few on my web-site at www.crescentcomputing.co.uk/laz/handoko

Corrected !!  Thanks Handoko
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 07, 2017, 08:56:59 pm
I managed to find out how to reproduce crash on Akira's version. It is 100% reproducible both running the code from IDE and from the binary directly. Tested using Lazarus 1.6.4 FPC 3.0.2 Gtk2 64-bit on Ubuntu Mate 16.10.

1. Download 3-4.tif provided by J-G, it is inside Set1
2. Run the program
3. Load that 3-4.tif
4. Repeat step #3, then the program will exit immediately
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 07, 2017, 09:36:01 pm
I managed to find out how to reproduce crash on Akira's version. It is 100% reproducible both running the code from IDE and from the binary directly. Tested using Lazarus 1.6.4 FPC 3.0.2 Gtk2 64-bit on Ubuntu Mate 16.10.

1. Download 3-4.tif provided by J-G, it is inside Set1
2. Run the program
3. Load that 3-4.tif
4. Repeat step #3, then the program will exit immediately

Most of the images in Set1 are 8 bit and 3-4 is the smallest at 444 bytes it is 300 dpi and 10 x 29 pixels.  I have similar images of music time signatures and none of them load.

On my system they simply don't appear in the thumbnail.

I've now put another file in Set1  -  Chi An.png  -  which loads as a thumbnail but is skipped over in the slide show. Again it is an 8 bit image but at 4800 dpi and 9351 x 4472 px.

@handoko  -  you'll have noticed that I've corrected my typo  :-[   one never checks ones own name !
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 08, 2017, 01:11:37 am
I managed to find out how to reproduce crash on Akira's version. It is 100% reproducible both running the code from IDE and from the binary directly. Tested using Lazarus 1.6.4 FPC 3.0.2 Gtk2 64-bit on Ubuntu Mate 16.10.

1. Download 3-4.tif provided by J-G, it is inside Set1
2. Run the program
3. Load that 3-4.tif
4. Repeat step #3, then the program will exit immediately

I think this problem only exists on Linux (more specifically, under GTK2). I tried making a slideshow that was just 25 copies of "3-4.tif" in a row and had no issues. I also tried continually loading it into the same image slot over and over again, and nothing went wrong. (I'm using Windows 10 64-bit with trunk FPC/Lazarus, just to clarify again.) Are you able to compile the application with the Debug profile and attempt to backtrace where/why exactly it crashes for you?

As far as J-G's images overall, almost all of them work perfectly for me. The only two that didn't were "Falls of Dochart 1A.tif" and "Canova Tomb.tif", which I noticed were LZW compressed and had bit depths of 32, whereas all of the other TIFs on his website (compressed and not) had bit depths of 24. After opening them in IrfanView and resaving them without compression, they loaded in glSlideShow. So it seems that the LZW decompression routine in the FPReadTiff unit (used internally by both TBGRABitmap and TPicture for loading TIFFS) only works on files with an original bit depth of 24 or lower.

I've attached a screenshot of a few of the images (including "beach.png", "Chi An.png" and "3-4.tif") in the midst of a ribbon transition. (Yes, that is the CodeTyphon logo in the top left corner.. I've been maintaining versions of the project files for both it and Lazarus, but I started with CT so that was the icon left in the folder.)

Also, @J-G: what are the hardware specs of the computer you're building/running the application on?


Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 08, 2017, 12:01:32 pm
I think this problem only exists on Linux.
The complete crash on second load probably - I don't get it on Windows - but I do get non-load and non-show errors with 8bit images and non-show on large 24bit images.

Quote from: Akira1364
So it seems that the LZW decompression routine in the FPReadTiff unit (used internally by both TBGRABitmap and TPicture for loading TIFFS) only works on files with an original bit depth of 24 or lower.
Well at least that seems to be a result - I did think about LZW compression but since I use that as a matter of course and it hasn't been a problem in the past, ignored my thought!

It seems reasonable that - for this application - the FPReadTiff unit only handles 24bit since it is intended only for screen display (RGB) rather than print (CMYK).

Much of my graphic work has a destination in print so CMYK (32bit) is again a default state, reverting to RGB (24bit) for work which will only be shown on the web. The images I tried were selected at random with a 'nod' toward 'size' or 'resolution'.

Quote from: Akira1364
Also, @J-G: what are the hardware specs of the computer you're building/running the application on?
M/b  -  ASUS M5A97LE
CPU -  AMD FX-6300 3.5GHz 6-core
RAM - 4Gb DDR3
Display - nVidia GeForce 9500 GT
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 08, 2017, 01:52:14 pm
Are you able to compile the application with the Debug profile and attempt to backtrace where/why exactly it crashes for you?

Debug build mode did not help. I even turned all the checks on (io, range, overflow, stack, verify, assertion), it just exited immediately without any error/warning message. But if I remove LoadImageDialog (TOpenPictureDialog), add a TOpenDialog and rename it to LoadImageDialog, it can load 3-4.tiff several times without crash . So it is clear the problem is in TOpenPictureDialog.

I will try to get some computers for more intensive tests.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 08, 2017, 07:29:11 pm
I'm back with my test result.

Software: Lazarus 1.6.4 FPC 3.0.2 Linux64 cross compile to Win32
Source Codes: glSlideshow Handoko version and Akira (Debug mode) version
Hardware: Intel Core 2 Duo with integrated NVIDIA 7100 (drivers installed properly).
OS: WinXP Service Pack 3

Handoko Version

Most J-G images were able to load and can be seen as thumbnails on the buttons. But most them will crash the program if playing the animation. The images that cannot be loaded will show "LZW stream overrun" message.

If the program crash, I have to use Task Manager to kill it. In some rare cases I have to press reset button.

Akira Version

Some of the images (5) that cause crash on Handoko version, can be played correctly on Akira version.

If the image fails to load, nothing will happen (no crash). The program will still run correctly.

I found 2 bugs, always reproducible:  (see the attachment below)
- When exiting the program a memory error message will show up
- Viewport not update, when starting the program

Image Loading & Playing Capability

                             Handoko    Akira
                            Load Play  Load Play
- 3-4.tif                     ✔   ✔      ✔   ✘
- Beach.png                   ✔   ✘      ✔   ✘
- BSL Logo.tif                ✔   ✘      ✔   ✘
- Canova Tomb.tif             error      error
- Card Background.tif         ✔   ✘      ✔   ✔
- Chi An.png                  ✔   ✘      ✔   ✘
- Dullcisima.tif              ✔   ✘      ✔   ✔
- Falls of Dochart 1A.tif     error      error
- Horns-Solar.tif             error      error
- Inn at waterloo.tif         ✔   ✘      ✔   ✔
- Leuven Town Hall.tif        error      error
- Menin gate.tif              ✔   ✘      ✔   ✔
- Paul Sings Dullcisima.tif   error      error
- snowflake BW.png            ✔   ✔      ✔   ✔
- snowflake BW NonInt.png     ✔   ✔      ✔   ✔
- vonEssen.tif                ✔   ✘      ✔   ✔
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 08, 2017, 09:01:31 pm
The complete crash on second load probably - I don't get it on Windows - but I do get non-load and non-show errors with 8bit images and non-show on large 24bit images.

Yeah, I was referring specifically to Handoko's problem.

M/b  -  ASUS M5A97LE
CPU -  AMD FX-6300 3.5GHz 6-core
RAM - 4Gb DDR3
Display - nVidia GeForce 9500 GT

That is a rather uncommon setup... 6-core AMD Vishera CPU with a graphics card from 2008? That being said, as the GPU does have 1 GB video memory and you have 4 GB system memory, you should technically be more than able to load any of the larger images from the collection you provided. The reason you can't could be caused by anything from shaky driver support on 64-bit Windows 7 for the old GPU, to conflicts between the CPU/GPU/Motherboard setup. (The latter would be somewhat rare, although it's highly unlikely that the BIOS of your motherboard was designed with any expectation of a DDR2-era graphics card being installed, so there could be some kind of compatibility issue there.)

One thing I should clarify though is, are you building the application as a 32-bit or 64-bit executable? If you're building it 32-bit, I'd strongly recommend trying 64, as 64-bit GPU drivers running under 64-bit operating systems are not optimized for 32-bit applications and tend to have a higher number of issues/bugs while running them.

Debug build mode did not help. I even turned all the checks on (io, range, overflow, stack, verify, assertion), it just exited immediately without any error/warning message.

Were you actually running the debug version under GDB, though? If so, there should have been at least some indication in the "Debug output" window of Lazarus as to where things failed...

I'm back with my test result.
Software: Lazarus 1.6.4 FPC 3.0.2 Linux64 cross compile to Win32
Source Codes: glSlideshow Handoko version and Akira (Debug mode) version
Hardware: Intel Core 2 Duo with integrated NVIDIA 7100 (drivers installed properly).
OS: WinXP Service Pack 3

The Nvidia 7100 only has 128 megabytes of video memory. You were also compiling the application as 32-bit and running it on a 32-bit operating system, meaning the application itself could only make use of a maximum 2 gigabytes system RAM. (As in, not enough to allow the graphics card to do any kind of sharing of the system memory when it begins to run out of video memory, which is a feature of some GPUs. I'm unsure if the NVidia 7100 is one of them, though.) Not that the application would generally need anywhere close to 2 gigabytes overall, it's just that it almost certainly wouldn't be deemed as enough "extra" system memory by the GPU driver to consider the sharing operation safe.

Those are, overall, what I would call "expected results." It's not reasonable to assume that the hardware you outlined there should be able to load images that are as large and high-DPI as the ones J-G provided (as they pretty much all take up more than 128 megabytes of video memory when uncompressed and uploaded as OpenGL textures.) Again, I tested all of the images on J-Gs website, and the only two that didn't work for me were "Falls of Dochart 1A.tif" and "Canova Tomb.tif" (because of the limitations of the FPReadTiff unit I described in my last post).

If the image fails to load, nothing will happen (no crash). The program will still run correctly.

That is very much on purpose/exactly how I wrote it to behave.

- When exiting the program a memory error message will show up

The heaptrc window is not an error. It's just the window that always shows when you close any application built with the heaptrc memory logging unit activated. On top of that the window in your screenshot actually confirms what I already knew, which is that there are no memory leaks in my version (not that anyone was assuming a leak was specifically the cause of any issues).

- Viewport not update, when starting the program

Not sure what you mean. When you're first starting the program, there's nothing to show as you haven't loaded any images yet, so it's blank. If you're referring to the garbled window in your second screenshot, that's almost certainly some kind of hardware issue/Windows XP issue. It should just be entirely white. Something seems to have gone wrong with the character encoding at some point in your cross-compilation process as well, as there's a bunch of characters displaying as squares when they should be actual letters.

Lastly, I was really far more interested in the issues you were having with my version running on your native Ubuntu installation, as any bugs that might be found there aren't ones I would come across myself running it on Windows. I'm unsure as to why exactly you thought cross compiling from Linux to Windows XP of all things would be useful or relevant...
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 09, 2017, 11:03:12 am
That is a rather uncommon setup... 6-core AMD Vishera CPU with a graphics card from 2008?
I'm of the opinion that 'if it ain't broke, don't fix it' and when I last needed to upgrade my system, the Video card did all that I asked of it so didn't need replacing. All of the images I've provided have been created/modified in either Photoshop (V7) or CorelDRAW! X5 without issue and I am running the latest drivers (updated due to the OpenGL issues raised).
Quote from: Akira1364
One thing I should clarify though is, are you building the application as a 32-bit or 64-bit executable? If you're building it 32-bit, I'd strongly recommend trying 64, as 64-bit GPU drivers running under 64-bit operating systems are not optimized for 32-bit applications and tend to have a higher number of issues/bugs while running them.
That's an interesting point and I've just done a test compile as a 32bit version -  it threw up 190 warnings and 1 hint, but did compile. Running it was 'painful' - it took about 3 times as long to load any image and didn't solve the 'thumbnail OK but no-show' nor the 'thumbnail non-load' problems - I wouldn't have expected it to really but in the interests of testing....
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 09, 2017, 02:36:02 pm
So, you were building it 64-bit to begin with, then? You realize I said "if you're building it 32-bit, try 64", not the other way around? Haha.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 09, 2017, 05:21:03 pm
So, you were building it 64-bit to begin with, then? You realize I said "if you're building it 32-bit, try 64", not the other way around? Haha.
I understood that Akira, I was simply being thorough in testing all possible scenarios.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 09, 2017, 07:28:47 pm
So, you were building it 64-bit to begin with, then? You realize I said "if you're building it 32-bit, try 64", not the other way around? Haha.
I understood that Akira, I was simply being thorough in testing all possible scenarios.

Fair enough. I just thought you might have misread what I said. On a more general note though, there is pretty much no situation where a 32-bit executable will ever perform better than a 64-bit executable on a 64-bit operating system...

Also, one thing we haven't tried yet with regards to your issues is debugging OpenGL itself, which is easier than you might think!

First, download and install the 64-bit version of the GLIntercept logging utility from here:
https://github.com/dtrebilco/glintercept/releases/download/1.3.4/GLInterceptx64_1_3_4.exe (https://github.com/dtrebilco/glintercept/releases/download/1.3.4/GLInterceptx64_1_3_4.exe)
 
Then go to the folder where it was installed (which by default will be C:\Program Files\GLInterceptx64_1_3_4) and copy and paste both "gliConfig.ini" and "OpenGL32.dll" from there into the folder where your 64-bit glSlideShow executable is located. The DLL is a customized debug version which hooks into any application that looks for one by that name (as glSlideShow obviously does) and will generate two log files when the application is closed: "gliInterceptLog.txt" and "gliLog.txt".

So if you run the application, attempt to load and play the slideshow with a few of the images that have not worked for you, and then post the two log files as attachments here it's likely I'll be able to get a good idea of what exactly the problem is.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 10, 2017, 10:41:29 am
Also, one thing we haven't tried yet with regards to your issues is debugging OpenGL itself, which is easier than you might think!
With your clear instruction - yes it is! :)

Two .TXT files uploaded to www.crescentcomputing.co.uk/laz/akira since gliInterceptLog.txt is 2252Kb and the attachment limit is 250Kb !

This is the result of loading Chi An, snowflake BW and Beach. All three do appear in the thumbnail but only snowflake displays in the slide show.



Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 10, 2017, 06:02:49 pm
Ok, so as I suspected the failures are happening when the application calls glTexImage2D in the "TSlideShowRenderer.CreateOpenGLTexture" method.

Line 134 of gliInterceptLog.txt:

Code: Pascal  [Select][+][-]
  1. glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,9351,4472,0,GL_BGRA,GL_UNSIGNED_BYTE,0000000021DC0000) glGetError() = GL_INVALID_VALUE

Line 234 of gliInterceptLog.txt:

Code: Pascal  [Select][+][-]
  1. glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,8297,5290,0,GL_BGRA,GL_UNSIGNED_BYTE,0000000030840000) glGetError() = GL_INVALID_VALUE

A GL_INVALID_VALUE result from glTexImage2D can mean quite a few different things, the relevant one here being that the width or height of the source image is greater than GL_MAX_TEXTURE_SIZE (which varies from GPU to GPU and is exactly what it sounds like, I.E. the maximum supported size in any direction of an OpenGL texture.)

I did a bit of research and it appears that on the Geforce 9500 GT, GL_MAX_TEXTURE_SIZE is 8192. So the first image (which I believe is "Chi An.png") has a width dimension that is 1159 greater than the maximum your GPU supports, and the second one (which I believe is "Beach.png") has a width dimension that is just 105 greater than the maximum.

As to why the TBitBtn thumbnails still work: it's because that part of the application is of course not using OpenGL, just normal software images that only make use of your main system memory. The exact order in which things happen is:

1) An image is loaded from file into a TBGRABitmap.

2) A calculation is done to figure out the necessary "thumbnail size" dimensions based on the width and height of the original image, and a second much smaller TBGRABitmap is generated by calling TBGRABitmap.Resample from the first one with those dimensions.

3) The second smaller TBGRABitmap has its data assigned to the glyph of the next empty TBitBtn, and is then freed.

4) An OpenGL texture is generated from the data of the original full-size TBGRABitmap. The original TBGRABitmap is then also freed.

So overall, there is unfortunately not going to be any way for you to use the very largest of your images in glSlideShow or any other OpenGL application with your current hardware.

I will point out though that GPUs are significantly less expensive in general than they used to be.... For example, you can get a Geforce GTX 1050 Ti for just $200 Canadian (which works out to around £125, since you seem to be from the UK) with 4 gigabytes of GDDR5 memory and a base clock speed of 1290 to 1300 mhz depending on the manufacturer. That is, for comparison, four times as much memory (and it's a much faster type of memory) than the Geforce 9500 GT, and a clock speed that's a little over twice as fast. There's also a variety of other benefits such as full support for modern OpenGL/DirectX/Vulkan specifications, and so on and so forth. GL_MAX_TEXTURE_SIZE is 32768 on all GTX 10 series cards.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 10, 2017, 07:49:20 pm
Well at least you've found a reason  :)   and many thanks for taking the trouble to do the research.   Though it doesn't address the fact that the 3-4.tif image at 10 x 29 px won't load even the thumbnail ????

You couldn't know, Akira, but I am very familiar with the costs of current graphics cards - I specify and build bespoke systems  :D  -  Your estimates don't take account of the fact that we (in the UK) don't get a true dollar conversion rate though, there is always an extra loading simply because the market will stand it :(

GTX 1050 Ti cards with 4Gb are in the range of £170 - £210  - I would of course not pay that much because I buy at 'trade' anyway - but the cost of a new card is not the only consideration.

First - for my real needs, what I have does the job very well, all the images I've put forward display in the two main programs that I use.

Second - I have a pair of ANALOGUE monitors which are perfectly adequate for my needs and all but two of the cards I've researched this afternoon have only one DVI-D connector, though admittedly they also have HDMI which could be converted to VGA if I really wanted to think about changing. And of course the two cards with 2 DVI-D connectors can't be converted to VGA anyway.

This Graphics Contest has been very interesting and thrown up issues that I hadn't previously considered. Most of my customers are home users or very light-weight 'office' with just the occasional 'Music' buff or 'Print Shop'. I did have one 'Video Editor' who was happy to pay for a very high end Matrox Card but he still owes me so I no longer support him  :o
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 10, 2017, 10:06:08 pm
Well at least you've found a reason  :)   and many thanks for taking the trouble to do the research.   Though it doesn't address the fact that the 3-4.tif image at 10 x 29 px won't load even the thumbnail ????

No problem!

As far as "3-4.tif" specifically, it definitely has nothing to do with OpenGL if the TBitBtn thumbnail isn't even showing for you, as the procedure is exited immediately if the initial TBGRABitmap fails to load meaning there's no OpenGL texture being created at all.

Again, I was able to use 3-4.tif myself with no issues (as shown in the screenshot I posted before), so the application code as currently written definitely does exactly what it's supposed to. I imagine the problem in your case likely has something to do with an internal difference somewhere in the sources of either the FPC RTL or the Lazarus LCL between the versions you're using and more recent ones.

What I think I might do is alter the loading routine a little bit so that it at least shows a message box containing information about what went wrong in the event of an error (while still not raising a "fatal" exception, as I think it's silly to make a user think they need to close the application just because one image fails to load, and there's no good reason to do so anyways as the code is already written to still properly free any memory allocated by the procedure in that case.)

For now though, you could simply try building the Debug profile of the Lazarus project, and running the application under GDB through Lazarus to see if you can get any more specific information about the problem.

GTX 1050 Ti cards with 4Gb are in the range of £170 - £210  - I would of course not pay that much because I buy at 'trade' anyway - but the cost of a new card is not the only consideration.

Oh yeah, I know it's not exactly going to be a direct price conversion. I was just giving a rough estimate, and the card was just one example... you could even go as far back as something from the 700 series (circa 2013 or so) and be in great shape. Although if you're able to get everything for trade/vendor costs or close to them anyways, I would think you could have your pick of most of what's currently available without breaking the bank.

First - for my real needs, what I have does the job very well, all the images I've put forward display in the two main programs that I use.

I don't doubt that at all, but it's important to keep in mind the difference between software rendering and hardware rendering, and what the use cases for each of them are.

I'm assuming the programs you're referencing here are CorelDraw and Photoshop, which you mentioned previously, both of which do everything at the software level (meaning using system RAM and your CPU, not the graphics card). This makes perfect sense as neither of them have any need to be able to render complex animations at high speed, and for the most part are displaying entirely static windows, so they make use of the (higher in essentially all cases than the GPU) amount of system RAM to get even the largest images on the screen for editing. As such, your graphics card while using those applications is not doing much more than driving the output to your monitor.

An application like glSlideShow, however, would simply not be able to smoothly render the rapidly changing animated frames at an acceptable speed if it was implemented at the software level. (As in, for example, if the rendering itself was done via BGRABitmaps built in drawing methods as opposed to just using BGRABitmap as a way to get images uploaded to the graphics card for use with OpenGL.)

This would of course be due to the latency caused by storing images in system memory versus storing them directly in graphics card memory, and by the fact that the result of the (less optimized, non-parallel) CPU-based drawing commands would just be getting interpreted for display at a raw pixel level by the graphics card (instead of being directly executed, generally in parallel, on the graphics card).

The significant boost in speed you get from hardware APIs like OpenGL does come with certain manufacturer-imposed limitations, however (such as the GL_MAX_TEXTURE_SIZE limit you encountered) most of which exist for reasons related to memory management concerns at the GPU level.

You may have already known some or all of that (or not), but I thought I'd post it anyways for anyone else reading the thread who might not understand the differences, haha.

And of course the two cards with 2 DVI-D connectors can't be converted to VGA anyway.

Not sure what you mean here. There's a variety of "active conversion" DVI-D to VGA adapter cables and dongles available from various manufacturers. They're used quite commonly in a lot of office environments to connect to analog VGA-only projectors.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 14, 2017, 03:52:24 am
Ok, I just uploaded a new set of files, with a few vaguely noteworthy fixes/improvements/additions:

-Added a checkbox that allows you to enable and disable VSync when supported (if the hardware doesn't support it, the checkbox is "greyed out".) The functionality is fully cross platform, using wglSwapIntervalEXT on Windows and glXSwapIntervalSGI on Unix-like systems.

-Fixed a bug where if you used the reordering popup menu to remove a slide from the lineup, and then added a new one, it would cause an access violation. This was the direct result of an oversight on my part, in that I just straight-up forgot to decrement the "Tag" property of the TBitBtns that weren't the one associated with the slide being removed from the lineup, meaning those values went out of range relative to the array that keeps track of them afterwards.

-Replaced the TOpenPictureDialog with a normal TOpenDialog just to ensure that any bugs that may have been being caused on Linux by TOpenPictureDialog won't happen anymore. This should have no effect on usability as I literally just copied and pasted the filters from TOpenPictureDialog.

-Various other little optimizations here and there. One being that the main form itself now only updates its caption when the current slide index changes, as opposed to every frame, as repainting the form bogs down the rendering loop. The main TOpenGLControl also now calls glViewport directly when necessary and longer uses the "AutoResizeViewport" property, as that property leads to wglMakeCurrent/glXMakeCurrent being called WAY more often that it needs to be. (The needed amount being once or twice at most during the entire time the application is running. Certainly not everytime the viewport is resized!) Additionally, I altered the image loading routines to use somewhat more robust/informative error-checking.

Here's the link to where you can download the zip file, once again:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447 (https://forum.lazarus.freepascal.org/index.php/topic,35313.msg255447.html#msg255447)

Also, I'm sort of wondering if it's worth me continuing to poke around at this codebase for at least the next little while? I honestly don't mind doing so at all as it's pretty trivial code for the most part and not really what I would consider "work", but if there's not much interest then I'm not sure I see the point.

If you're someone who'd like me to keep working on it let me know, so I at least know you're out there!
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 15, 2017, 12:39:53 am
I can tell that you’ve felt abandoned Akira :)    I’ve been out of the loop for a few days on an urgent mechanical design project.

My interest in glslideshow was originally to see how images could be manipulated but it later became an issue about why some images wouldn’t load and later still how my hardware fell short.

I currently have no real need to manipulate images quickly - as in animation - but I am looking at Blender which would change that considerably but I have a number of 'irons-in-the-fire' which may mean that the interest in Blender doesn't get very far!

I’ve just compiled and run your latest incarnation and tried to load the 3-4.tif image which reports ‘Offset outside of stream at position 164' - all the other music time signature files also fail reporting the same error at position 166, 167 or 169. You may understand the meaning of E.message  - I couldn’t possibly comment :)

At least you’ve reminded me of the issue of ‘software’ versus ‘hardware’ rendering. Although I was aware of the difference I hadn’t felt a need to investigate the ‘detail’.

As far as DVI-D to VGA is concerned - again I haven’t needed to look for such an adaptor for some time so was quoting from old memory and we all know that in this industry yesterdays information is history !
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 15, 2017, 06:26:52 am
I can tell that you’ve felt abandoned Akira :)    I’ve been out of the loop for a few days on an urgent mechanical design project.

Haha, I wouldn't say abandoned.... When I said "you" in the last post I meant "you" generally as in "you, the person reading this post, who could be anyone." Sorry if you thought it was directed specifically your way. Basically I just meant that there seem to be a lot more people viewing the thread than commenting in it! And it would be nice to have input from as many different people as possible.

I’ve just compiled and run your latest incarnation and tried to load the 3-4.tif image which reports ‘Offset outside of stream at position 164' - all the other music time signature files also fail reporting the same error at position 166, 167 or 169. You may understand the meaning of E.message  - I couldn’t possibly comment :)

I'll have to look into that. Sounds like something from FPReadTiff again...

Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 15, 2017, 09:23:30 am
I would be more interested in smoother animation. Akira, you know a lot in OpenGL, can you please help me solve this issue?

I guess you already know, in my version I do not increase TTimer's Interval to make the animation slower. It increases StepsTotal to make to movement smaller. And that's the problem.

If you set the Moving Speed to the maximum ( =500, see the attached screenshot ), you will notice the image quality is bad. The issue is something similar to antialiasing problem. It will be very noticeable on images that has line pattern with high contrast color (snowflake BW.png).
 
The animation basically is okay. It is texture antialiasing issue. I thought by using 4x multisampling will solve it, but I am wrong.

Do you know how to solve the bad texture resizing quality problem?
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on September 15, 2017, 05:54:14 pm
I think that is about filtering (GL_LINEAR would be one of the smooth options) and perhaps even mipmapping would make it better.

Example of mipmapping: https://textureingraphics.files.wordpress.com/2011/12/mipmap1.png
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 15, 2017, 06:01:14 pm
I checked my source code. It's already using GL_LINEAR. The gls_PrepareOpenGLForPainting procedure is in uniGraphics.pas line #181: 

Code: Pascal  [Select][+][-]
  1. procedure gls_PrepareOpenGLForPainting;
  2. begin
  3.   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  4.   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  5.   glClearColor(BackgroundR, BackgroundG, BackgroundB, 1);
  6.   glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
  7.   glLoadIdentity;
  8. end;

Did I do something wrong?
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 15, 2017, 11:57:23 pm
I'll post a detailed explanation about this along with a new upload of my version that includes/demonstrates it when I'm at home in a couple of hours.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 16, 2017, 05:07:25 am
Ok, I'm here:

What User137 said is correct. You need to use mipmapped filtering, which essentially means that OpenGL generates a series of gradually smaller pre-scaled versions of a texture that it then automatically chooses from when rendering, based on the current coordinates of the current OpenGL matrix as well as the texture coordinates you supply it with. This prevents the ugly flickering that you would normally get otherwise using simple linear filtering (which can only do an "approximate" filter pass on the full size image in real time.)

To enable it in your version, you would first need to change the gls_PrepareOpenGLForPainting procedure to look like this:

Code: Pascal  [Select][+][-]
  1. procedure gls_PrepareOpenGLForPainting;
  2. begin
  3.   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  4.   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
  5.   glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
  6.   glClearColor(BackgroundR, BackgroundG, BackgroundB, 1);
  7.   glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
  8.   glLoadIdentity;
  9. end;

Your version also has a function called TextureFromBitmap that would need to be changed to look like this:

Code: Pascal  [Select][+][-]
  1. function TextureFromBitmap(Image: TBitmap): GLuint;
  2. var
  3.   Texture:  GLuint;
  4.   ATexture: array[0..0] of GLuint absolute Texture;
  5.   Viewport: array[0..3] of GLint;
  6. begin
  7.   glGenTextures(1, ATexture);
  8.   glClearColor(BackgroundR, BackgroundG, BackgroundB, 1);
  9.   glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
  10.   glMatrixMode(GL_PROJECTION);
  11.   glScalef(1, -1, 1);
  12.   DrawScene(Image);
  13.   glLoadIdentity;
  14.   glBindTexture(GL_TEXTURE_2D, Texture);
  15.   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  16.   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
  17.   glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
  18.   glGetIntegerv(GL_VIEWPORT, Viewport);
  19.   glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0,
  20.     Viewport[2], Viewport[3], 0);
  21.   glBindTexture(GL_TEXTURE_2D, 0);
  22.   Result := Texture;
  23. end;

A note about the TextureFromBitmap function though: generating an entirely new texture every frame with glGenTextures is extremely slow. This is why my version creates all the textures before any rendering is done, and simply stores their handles as well as the filename, aspect ratio, width and height of the original image in a record. (Meaning, the TBGRABitmaps that they're created from are never stored anywhere, and only exist temporarily during the loading procedure.) From there, the records are passed to the rendering methods, which then just call glBindTexture on the handles to switch between them.

If you want to get an idea of the speed difference, load an image of around 3072x3072 or larger in your version and then try to use it with any of the Wipe, Blind, or Matrix transitions. Then do the same thing in mine.

I also added another checkbox to my version today that allows you to toggle instantaneously between mipmapped and non-mipmapped textures, to allow for easy comparisons. I've attached two screenshots below that pretty much recreate the last one you posted of J-Gs Snowflake images: one with mipmapping turned on, and one with it turned off. (The difference is more noticeable in the actual application when it's actually moving, of course, but it still comes through pretty clear in the PNGs.)

Lastly, I've uploaded a new zip file (which is also attached to this post) with the updated project files and source files for my version, for anyone who wants to get a better idea of how to go about implementing any of what I've just described. (One other thing I did today was add some Carbon and Cocoa widgetset specific defines/implementations throughout the code, and as far as I can tell it should now compile/work on those platforms. So if any Mac users specifically want to give it a test as well, that would be quite helpful!)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 16, 2017, 06:12:04 pm
Thank you. I'm now busy with a website project (I'm a web designer too  :D), I saved your code and will study it later.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 17, 2017, 10:41:36 pm
A note for anyone who already downloaded the zipped project files from my last post:
 
I just replaced the zip file with a new one, as I realized there were some mistakes in the defines I added for the Carbon and Cocoa widgetsets. I ended up noticing a few minor issues (affecting all widgetsets) related to pausing and playing the slideshow as well though that I've now fixed, so I'd recommend you re-download the file regardless of what platform/widgetset you're using.

Edit: Also, to specifically address the issue J-G was having loading his 1-bit "3-4.tif" image: I looked at the github history of FPReadTiff, and found that it was last updated in October 2015 (as in, after the release of FPC 3.0.0). I temporarily replaced the copy of FPReadTiff in my trunk source tree with the one from the next earlier update than that (which was in April 2015), and received the exact same error message he did upon trying to load the file.

So as I suspected, the problem originates in FPReadTiff but has been fixed in the time since FPC 3.0.0 was released. The only way anyone using FPC 3.0.0 or lower will be able to load 1-bit TIFF files in glSlideShow (or any Lazarus application really, as TPicture, like TBGRABitmap, also uses FPReadTiff to load them) is to either update to a minimum of FPC 3.0.2, or at least replace their copy of FPReadTiff with one from any source tree released later than October 2015.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 18, 2017, 12:19:25 pm
Edit: Also, to specifically address the issue J-G was having loading his 1-bit "3-4.tif" image: I looked at the github history of FPReadTiff, and found that it was last updated in October 2015 (as in, after the release of FPC 3.0.0). I temporarily replaced the copy of FPReadTiff in my trunk source tree with the one from the next earlier update than that (which was in April 2015), and received the exact same error message he did upon trying to load the file.

So as I suspected, the problem originates in FPReadTiff but has been fixed in the time since FPC 3.0.0 was released. The only way anyone using FPC 3.0.0 or lower will be able to load 1-bit TIFF files in glSlideShow (or any Lazarus application really, as TPicture, like TBGRABitmap, also uses FPReadTiff to load them) is to either update to a minimum of FPC 3.0.2, or at least replace their copy of FPReadTiff with one from any source tree released later than October 2015.

Again, you've come up trumps Akira and solved the problem. I'm sure there are many readers who (like me) forget that FPC/Lazarus are - like Easter - a moveable feast  :D

This only matters when you have programmers using different stages of development providing code fragments to all and sundry  -  ie. this 'Graphics Contest'  -  which is great for disseminating programming ideas but can also bring 'issues' to the fore which may or may not need addressing in 'local' code. The chance of me wanting to display 1-bit images in any program I write is practically zero.

The only reason I have those music time signature images at all is that they were used in some Concert Poster design work and should I need to use them again it would be in CorelDRAW! which doesn't need to use hardware display techniques.

Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on September 18, 2017, 01:24:33 pm
In the future the troubleshooting for specific projects should be put in its own thread in my opinion. We have strayed far offtopic from the graphics contest.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 18, 2017, 07:14:15 pm
In the future the troubleshooting for specific projects should be put in its own thread in my opinion. We have strayed far offtopic from the graphics contest.

Well, the contest is over for one thing... and we're discussing an application originally written by Handoko for the contest, that I've since "forked"/largely rewritten for the purposes of providing examples of better/faster ways to use OpenGL to implement the rendering effects it does. (Any of which could be taken and applied to any other project for the most part, which is why I've been posting the project files for my version.) Wasn't the whole purpose of the contest education?

Also, J-Gs TIFF issue was an issue that anyone else could just as easily have in a large variety of other Lazarus-based applications, so I thought it was worth pointing out what the exact cause of and solution for it were.
Title: Re: Graphics Contest 2017, please vote now!
Post by: J-G on September 18, 2017, 07:53:21 pm
Wasn't the whole purpose of the contest education?
Yes  -  and I've certainly learned a great deal.

Quote from: Akira1364
Also, J-Gs TIFF issue was an issue that anyone else could just as easily have in a large variety of other applications, so I thought it was worth pointing what the cause of and solution for it were.
I hadn't previously thought to test the same images after converting to .PNG since I was hung up on the 1-bit issue but I've just converted one of the time signature files to a 1-bit .PNG and it both loads to thumbnail and displays in the slide show. Another lesson learned  :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on September 19, 2017, 05:13:59 pm
Well this was really a success this year!

The next year we can focus on OpenGL only.

And maybe we can create the categories at first, like a new post for each category:
- Games
- Animations
- ...

Maybe also we can create a proper github organization for the contest, and put everything there, all the current and old repositories with all the projects (I will do that soon).

I need to grab all the sources for Handoko's project, the most popular this year.

I enjoy a lot this kind of participation, I feel really good with all the comments and feedback for each project.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 19, 2017, 06:59:56 pm
I learned a lot from this contest. Game/graphics codes written in Pascal are hard to find, learning different coding styles is good for improving my skills. I can learn not only Akira's OpenGL tricks but also how he rewrote my code using OOP approach. I know OOP but not as good as him. I especially interested with nxPascal and the graphics engine behind Educrace, I will spend some time to study them.

About the source code of Furious Paladin, I just received an email from Nuno some days ago:
Quote
Hi,
Thanks for the fix.  I had a busy summer and I hadn't had time to look at this until now.

You can get Furious Paladin's source code from Nuno's Allegro.pas website. But because he is busy, he hasn't checked the code, so the code has not published yet. After he make the source code available then I will write the tutorial about it.

May I suggest a new category?
Android graphics effects and games.

Actually I wanted to submit 3 programs for this contest. The third one was graphics effect using jmpessoa's LAMW. It already works on my Android phone, it is a 2D OpenGL ES2 effect. But it still has some minor bugs and I did not have time to fix it so I did not submit it to the contest.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Ñuño_Martínez on September 20, 2017, 01:53:40 pm
Hi people,

this summer was too much busy for me and I'm still recovering my life-after-summer or something. %) Anyway I miss the contest (may be next time :() and I had 15 pages of unread messages:  too much for me.

@Handoko: I've replied your e-mail.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 21, 2017, 01:39:10 am
I learned a lot from this contest. Game/graphics codes written in Pascal are hard to find, learning different coding styles is good for improving my skills. I can learn not only Akira's OpenGL tricks but also how he rewrote my code using OOP approach. I know OOP but not as good as him. I especially interested with nxPascal and the graphics engine behind Educrace, I will spend some time to study them.

I'm not familiar with the EducRace code, but I can definitely attest to nxPascal being a fantastic library (with probably the most impressive example demos out of any similar Pascal-based OpenGL library.) However... everything about it would perform far better than it already does if the author (User137, I think) didn't use immediate mode (which again mean glBegin/glEnd style rendering) everywhere!

That's one of the main things I was trying to demonstrate with my version of glSlideShow: that there are much faster and more efficient (and easier to code in my opinion) ways to implement things with OpenGL than immediate mode (meaning glBegin/glEnd), without even going above OpenGL 1.2 / 1.3 / 1.4 or so (such as glVertexPointer/glTexCoordPointer/glDrawElements and such, as I made use of). So just as a general note/"thing to keep in mind" for anyone reading this:
 
Remember that anytime you use glBegin/glEnd, you are using the absolute earliest, slowest possible method of OpenGL rendering! It is functionality that's literally without exaggeration straight out of 1994. Please please don't use it in any new projects that you're writing from scratch right now, as doing so places a pretty severe "hard limit" on how far your application can scale up performance wise (as in if you ever wanted to introduce higher-resolution textures, more complex particle systems, and so on and so forth.)
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on September 21, 2017, 02:08:08 am
I'm not familiar with the EducRace code, but I can definitely attest to nxPascal being a fantastic library (with probably the most impressive example demos out of any similar Pascal-based OpenGL library.) However... everything about it would perform far better than it already does if the author (User137, I think) didn't use immediate mode (glBegin/glEnd) everywhere!
There is easy to use support for vertex arrays and VBO's. I believe the pixel shader demo wouldn't even be possible with immediate mode rendering. You can also speed it up by using TCamera to manually calculate camera matrix. You can save up thousands of matrix multiplications per second by storing the matrix and reusing it. There is simple 2D rendering that uses VBO aswell if i remember right for rotation, scaling, patterned textures and so on. This was done by caching triangles in an array and them draw them all in 1 pass.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 21, 2017, 02:19:21 am
There is easy to use support for vertex arrays and VBO's. I believe the pixel shader demo wouldn't even be possible with immediate mode rendering. You can also speed it up by using TCamera to manually calculate camera matrix. You can save up thousands of matrix multiplications per second by storing the matrix and reusing it. There is simple 2D rendering that uses VBO aswell if i remember right for rotation, scaling, patterned textures and so on. This was done by caching triangles in an array and them draw them all in 1 pass.

Not sure which demo you're referring to exactly... What was the project name for it? There's definitely nothing that's "impossible without immediate mode".... and while yes, the library does have support for vertex arrays (although it seems somewhat incomplete in the case of VBOs), you definitely don't use it in most of your core rendering methods.

Also I wasn't even really talking about VBOs and other "current" functionality here. (It's true they're the only correct way to do things nowadays along with VAOs and shaders, and certainly what I would normally use myself, but at the same time they're definitely somewhat far outside the OpenGL experience level that most people in this forum seem to have.)

One thing at a time, as they say! IMO for gradual learning purposes it makes more sense to start with client-side vertex arrays, as the general concepts there can be easily applied to VBOs and shader uniforms later on (and client-side vertex arrays are still a lot faster than glBegin/glEnd in the meantime.)
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on September 21, 2017, 03:24:54 am
Not sure which demo you're referring to exactly... What was the project name for it? There's definitely nothing that's "impossible without immediate mode".... and while yes, the library does have support for vertex arrays (although it seems somewhat incomplete in the case of VBOs), you definitely don't use it in most of your core rendering methods.
I meant "impossible with immediate mode". And i'm not even sure, just something i vaguely remember...

Not sure if we can call them "core methods". It gives alternative ways to render, and if using TRenderer, it definitely isn't immediate mode. One example was from Walker_shader code:
https://github.com/Zaflis/nxpascal/blob/master/demos/fpc/walker_shader/GraphicsUnit.pas#L73
But that demo wasn't made to use TCamera, which was instead shown in the Model demo:
https://github.com/Zaflis/nxpascal/blob/master/demos/fpc/model/Unit1.pas#L76
Neither of the demos are internally using glBegin...

As for being incomplete, i don't really know. Everything i tested so far worked, only what it lacks is more actual GLSL shader code examples. I'm not that good in writing shaders.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Akira1364 on September 23, 2017, 01:37:50 am
I meant "impossible with immediate mode". And i'm not even sure, just something i vaguely remember...

Ah, makes more sense, haha.

Not sure if we can call them "core methods".

Well, when I said "core rendering methods" I was referring to all the methods in the "TNXGL" and "TParticleEngine" classes and so on and so forth, which do indeed amount to a whole lot of glBegin(GL_QUADS) and essentially nothing else.

Again though, my overall point wasn't really about nxPascal specifically at all... What I was getting at basically boils down to "there's essentially no advantage to using OpenGL over a software rendering library, if you're going to use slow deprecated OpenGL from the early 1990s."

Like I said before, nxPascal is an awesome library that technically does what it's supposed to do, but it's not a good example of the right/ideal/best/fastest way to write OpenGL code in 2017 (or 2007, for that matter...)

So my initial response to Handoko about it was basically just trying to prevent him (or other users who are relative OpenGL beginners or slightly more than beginners) from looking at the nxPascal codebase and thinking "oh, well, this must be exactly how you're supposed to do it then, since that's how it's done here!" when they come across the various immediate mode parts.
Title: Re: Graphics Contest 2017, please vote now!
Post by: User137 on September 24, 2017, 04:23:39 pm
I made an issue in Github, if you have more ideas or recommendations for best practises
https://github.com/Zaflis/nxpascal/issues/7
I agree it doesn't make sense that particle engine is still using old way, but at the same time i might rid of all the others as well. To me it would make more sense and be simpler to use VBO (TRenderer) than just manually operated vertex arrays because the caching code is already there. But also i do want to get rid of Delphi support and start to use operator overloading in math code, and that would also mean dropping support for old FPC versions.

Obviously i will keep zip backup of the old sources, they just won't be updated with new features. Further on i'm aware there is a lack of tutorials or demos. Maybe that is right place to discuss those things: http://forum.lazarus.freepascal.org/index.php/topic,16149.0.html
I mean, what is the thing you miss the most?
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on September 27, 2017, 04:15:30 pm
@Handoko: I've replied your e-mail.

Which one? The latest email I received from you was on 14th September 2017.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on October 01, 2017, 04:35:34 pm
And we're in October!

3 months left to the next year contest!?  ::)

I think one user more experienced with OpenGL should be in charge for the next year Graphics Contest 2018, if we will focus on OpenGL of course.

I did the graphics contest the last three years, but I know nothing about OpenGL, in fact I know almost nothing about graphics (internal functions), but only how to use BGRABitmap.

So if someone is interested to take charge feel free.
Title: Re: Graphics Contest 2017, please vote now!
Post by: Ñuño_Martínez on October 04, 2017, 06:51:37 pm
@Handoko: I've replied your e-mail.

Which one? The latest email I received from you was on 14th September 2017.
I should revise my mails.  Too busy.  %)
Title: Re: Graphics Contest 2017, please vote now!
Post by: turrican on November 15, 2017, 02:39:35 pm
Hi people I'm back! I was out... Much work and my little daughter keeps growing up! Sorry about my absence :(

My example is very far about finished (30 min of coding  :P)! and its a example for my framework (Game Framework) not a proyect at all (you can vote my framework not the example  ;)) but no problem thanks for test it, I will have more time from now and I can compete in the next contest.

For next contest... I would like to program a game (Can?  :-X)

My vote are 1 point to everyone (not my test :)) because time invested and quality of all projects (mario clone not!!!)

Thanks everyone!





Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on November 25, 2017, 12:37:34 am
Waiting 2018 for the next graphics contest!  ::)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Ñuño_Martínez on November 25, 2017, 11:53:08 am
Me too.  I hope I can do something this time. :)
Title: Re: Graphics Contest 2017, please vote now!
Post by: Handoko on December 28, 2017, 02:15:56 pm
Sorry for providing the source code of Furious Paladin too late. You can get the source at Allegro.pas repository:
https://sourceforge.net/p/allegro-pas/code/HEAD/tree/TRUNK/demos/

Nothing special about the code but one of the thing I think great is the trick to handle sword swinging:
When swinging your sword, enemies (in front of you) still can hurt you if the swinging haven't reach certain progress.

The trick is done by comparing the AnimProgress:

Code: Pascal  [Select][+][-]
  1. type
  2.   TActor = record
  3.     PosX, PosY:      Real;
  4.     MinX, MaxX:      Real;
  5.     Speed:           Real;
  6.     CurrentActivity: TActivity;
  7.     LastActivity:    TActivity;
  8.     AnimImage:       ^TImageList;
  9.     AnimProgress:    Byte;
  10.     AnimDelay:       Byte;
  11.   end;
  12.  
  13. // ....
  14.  
  15.   // Check player attacks
  16.   if ((Player.CurrentActivity = AttackL) or (Player.CurrentActivity = AttackR)) and
  17.     (Player.AnimProgress = 4) and (Player.AnimDelay = 1) then begin
  18.       al_play_sample(AudioSword, 1, 0, 1, ALLEGRO_PLAYMODE_ONCE, nil);
  19.       with Player do
  20.         for i := 0 to (Enemies.Count-1) do begin
  21.           Enemy := Enemies[i];
  22.           if (Player.CurrentActivity = AttackL) and
  23.             BothIntersect(PosX+15, PosX+40, Enemy^.PosX+30, Enemy^.PosX+65) then begin
  24.               if (Enemy^.CurrentActivity <> KilledR) then Inc(EnemyKilled);
  25.               Enemy^.CurrentActivity := KilledR;
  26.           end;
  27.           if (Player.CurrentActivity = AttackR) and
  28.             BothIntersect(PosX+55, PosX+80, Enemy^.PosX+33, Enemy^.PosX+68) then begin
  29.               if (Enemy^.CurrentActivity <> KilledL) then Inc(EnemyKilled);
  30.               Enemy^.CurrentActivity := KilledL;
  31.           end;
  32.         end;
  33.     end;
%) wow the code above looks so compliated.

I will write a complete step-by-step tutorial explaining how this Furious Paladin's code works. But maybe some months later, I'm a bit busy at the end of this year.
Title: Re: Graphics Contest 2017, please vote now!
Post by: lainz on December 28, 2017, 03:25:06 pm
Thanks for sending us the game! I've added that to the list of the games of the graphics contest 2017 in the games sub forum.
TinyPortal © 2005-2018