ABCanvas with TCG Game

Once again, thank you Alain for your help with the Canvas book. Charles, there are many types of games which can be created with the canvas, such as turn-based games, some light animation, a large amount of picture editing/creation and more. I would probably not create a first-person-shooter game with a canvas until the speed can be increased.

I am currently working on an OpenGL book with the help of some code from Alwyn and others, and OpenGL seems to able to handle a first person shooter game at higher frames-per-second on Windows and Mac (haven’t tested it on Linux yet). The trade-off is that OpenGL is significantly more complicated than programming the Canvas. A good learning path would be to become fluent in working with/drawing/editing and manipulating a Canvas. Many of these fundamental principles (z-order, how to calculate frame rates, math, increasing speed, transparency, etc.) should be known, and once you are completely fluent with Canvas programming, then this would be a good time to start learning OpenGL.

It does take a while to learn the canvas, and as many others have mentioned, a large dose of patience and perseverance helps :slight_smile:

@Eugene : maybe put a link to your book here, incase he doesn’t find it.

Thanks for the suggestion Christoph.

A link for a free preview with the Table of Contents and view some material within the book ‘Canvas Control with Xojo Desktop’ can be viewed Here .

The book, along with many other resources, can be purchased at Xojo Library and look for the title Program the Canvas Control with Xojo Desktop.

Happy to help :slight_smile:

slightly off topic… but is it a good idea to waste your resources on a Xojo book about OpenGL? especially since Apple themselves are going toward Scenekit instead? I know SceneKit isn’t exposed officially to Xojo, but I also know that Ulrich is/has done some work in that direction.

Dave, you always have good questions! There were two reasons for choosing OpenGL, and the main one was because it is cross platform and the other was because of the increased speed with Xojo. I am sure that DirectX for Windows and SceneKit for Apple would be faster for each platform, and the code would be difficult to transfer from one OS to another. There may be some minor changes to make between different OS’s with OpenGL, and they would likely be small in comparison. OpenGL works on Windows, OSX, iOS, Android, and Linux, and I am sure there are more.

Will there be a Scenekit or DirectX book in the future? Yes, it is possible, and I am not sure when. Since the release of the Canvas Control with Xojo Desktop book, I have had many emails with good suggestions for adding material and possibly increasing the speed to have the Canvas do even more good things with Xojo.

I am really interested to see what Ulrich is able to do with SceneKit. These are exciting times!

Eugene… good point… I will admit that I don’t think in “cross platform” terms all the time… I’ve played with SceneKit in Swift and while it too can be complex (if you are doing complex things)… it is far easier to do simple things that OpenGL (but as you stated, only for macOS and iOS, not for Windows or Linux)

Not much currently – I’ll need some time to rebuild SceneKit first, and to include it on both platforms.
The first rough iOS implementation looked very promising, but yes, as you wrote: Only OpenGL is xplatform, but much more complicated, while OS-native solutions like SceneKit or DirectX are more powerful and easier to handle at the same time, but limited to certain systems. Or rather Scene- and SpriteKit are full-featured game and simulation engines and Metal is the new GPU interface beneath. I guess that’s why they came up with something like Unity - to have a convenience xplatform wrapper for the different sophisticated engines.

Anyway, I‘ll send you a notice when I built SceneKit into a useful state again, Eugene. It would be great to have a reason to explore the possibilities, because frankly I don’t know even for SpriteKit (which still lacks a few of the newest classes) yet.
Currently I am working on the CIFIlter classes that both can use and still cannot decide: Build around 150 subclasses with only the fitting properties or extend the quick & dirty approach where the programmer has to figure out what properties can be used? …

Thank you Ulrich, I appreciate it.

This seems to be the question that most programmers have, and I honestly don’t know the answer. My joking answer is to implement the methods that I want , and finish the remaining methods later. :slight_smile: With all of your knowledge of SceneKit and Xojo, I am sure that you will make the best decision, whatever that decision is.

Thanks a lot, @Eugene!
That was good advice: I created a lot of things I might need now or later and will extend them from time to time or on demand. Now I “only” have to create the different constructors for iOS, and then I declare this part finished (and open) for now