Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 99
» Latest member: Ivo van der Veen
» Forum threads: 233
» Forum posts: 981

Full Statistics

Online Users
There is currently 1 user online
» 0 Member(s) | 1 Guest(s)

Latest Threads
Arise dead book?
Forum: Scratchpad Games
Last Post: Brian Beuken
02-29-2024, 08:07 AM
» Replies: 0
» Views: 257
Im working on a Game..
Forum: Scratchpad Games
Last Post: Brian Beuken
08-04-2023, 10:58 AM
» Replies: 8
» Views: 13,856
OpenGL Error handling
Forum: Assets, Tools, Libraries and other useful things
Last Post: Brian Beuken
12-07-2022, 11:48 AM
» Replies: 0
» Views: 3,851
Rock Pi5B
Forum: Other SBC's
Last Post: Brian Beuken
11-12-2022, 10:14 PM
» Replies: 5
» Views: 7,633
Setting Up Bullet
Forum: Assets, Tools, Libraries and other useful things
Last Post: Brian Beuken
10-12-2022, 11:36 AM
» Replies: 3
» Views: 11,615
Building with a toolchain
Forum: General Chat
Last Post: junglie85
09-11-2022, 07:45 AM
» Replies: 3
» Views: 8,551
Window doesn't open on Pi
Forum: Help my code won't work??
Last Post: junglie85
09-05-2022, 01:28 PM
» Replies: 5
» Views: 6,179
Getting started on Raspbe...
Forum: Help my code won't work??
Last Post: junglie85
09-04-2022, 06:38 AM
» Replies: 8
» Views: 8,324
Bullseye on Rpi2/3
Forum: Help my code won't work??
Last Post: Brian Beuken
04-25-2022, 03:24 PM
» Replies: 8
» Views: 10,084
Disable OpenGL, for faile...
Forum: Help my code won't work??
Last Post: Brian Beuken
11-10-2021, 06:43 PM
» Replies: 7
» Views: 18,158

 
  Library changes
Posted by: Brian Beuken - 03-15-2018, 08:51 AM - Forum: Fundamentals Errata/Questions - Replies (6)

The book code was written in Rasbian Jessie, which updated in Nov 2017 to Stretch, I wasn't able to make edits to the book at that point as it was being prepped by the publisher.

For the most part you will not notice any real issues, but where Jessie only needed bcm_host, GLESv2 and EGL libs, to get graphics up and running, on Stretch a few more files are needed and you won't get code to build without them.
 
So make sure you have these when you are entering the 1st couple of projects

GLESv2_static EGL_static vchiq_arm vcos khrn_static bcm_host pthread

If you just update/upgraded your old Jessie version you will find you still have the old libs and they will still work just fine, you have in fact a hybrid of Jessie and Stretch, but the sooner you update to the new version and the new libs the better.

Print this item

Wink first code won't run
Posted by: pahendriks - 03-14-2018, 10:32 PM - Forum: Help my code won't work?? - Replies (11)

Hi,

I bought your e-book last week in Holland. I'm a guy who used to code on the Commodore Amiga in the nineties. I created a pacman clone in assembler. See https://www.youtube.com/watch?v=nsgAFKIdlJ4 for my creation which I finished in 1992.

So I started with your book ands bought the Raspberry Pi (I think 1 day before the 3B+ was released). So I have an 3B. And Yesterday also a new release of the linux distri was released. So I was a little bit too early...

I managed to update the pi and it worked ok. The hello World program worked fine.

After typing in the source for 'my first triangle' I had some type errors but it seemed ok finally. I ran the program and nothing happened. So I read that I had to update the library settings as mentioned here: http://www.scratchpadgames.net/DownLoad.html

But after that my code does not run after these changes. I get some errors which I can not solve.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets
The command ""C:\Program Files (x86)\Sysprogs\VisualGDB\\VisualGDB.exe" /build "C:\Users\Patrick\source\repos\GameProject1B\GameProject1B\GameProject1B.vcxproj" "/solution:C:\Users\Patrick\source\repos\GameProject1B\GameProject1B.sln" "/configBig Grinebug" "/platform:Win32"" exited with code 1.

C:\Users\Patrick\source\repos\GameProject1B\GameProject1B\collect2
ld returned 1 exit status

C:\Users\Patrick\source\repos\GameProject1B\GameProject1B\VisualGDB
Command-line action failed

Can you help me solve these errors?


Best regards from Holland!

Patrick

Print this item

  New Raspberry 3B+
Posted by: Brian Beuken - 03-14-2018, 10:02 AM - Forum: Raspberry Pi questions - Replies (2)

Yeahhh its new Raspberry Day Big Grin and the 3B gets the upgrade treatment to 3B+.

From the specs it seems that there's really nothing new that will make much impact on us, a bit more CPU power is always good, and with it a tiny bit more GPU(may be on the horizon soon), but its still the ageing, though well supported, Videocore IV GPU, sadly still a dual core.  Sad
What a shame, a quad core version would have literally doubled its performance, but hey ho, an extra 200Mhz is not to be sniffed at.
Faster networking makes comms to VisualGDB a bit better, so faster build/compile too..its all good really.

I was kinda hoping for an Octocore 4B with a 16core OpenGLES 3.2 GPU, but until then I can play with the Odroid XU4.
Maybe next Pi Day!

I've put in my order and will give a report on any issues as soon as I can.

Print this item

  MyLibs
Posted by: Brian Beuken - 03-13-2018, 05:31 PM - Forum: Assets, Tools, Libraries and other useful things - No Replies

The Mylibs examples are not intended to be do everything kinds of systems, its mainly a collection of all the general functions and utility classes we built up in the successive 2D projects which allows you then to contain them all in one static lib and avoid repeating files and classes.

You should really put the library in a standard usr dir on your target. I currently let it use a VGDB dir in the tmp dir, so it needs rebuilding as it will be cleared each reset of the target.

In development of the book, while making projects I included the Mylibs project in my game solutions. With hindsight this was not a great idea, as the library developed over the course of 3 or 4 games. So it contains much more than you probably need in the 1st few games, and some of the code you can see in there, is not discussed in the 1st few games that use it.  But it stands as a good example of how to make a user lib, which you can base your games on and add to as you build further games.

I removed the Mylibs Project from the solution files of games that use it, leaving you to either add it yourself as a project in the solution or more sensibly to build the Mylibs.a and include the directory in your project properties, remember also to include the header directories for it to use the library.

I don't use a lib in the 3D games, so that users can see the common concepts and build their own 3D lib for a series of games if they want to. Also A lot of that 3D code really needs to be optimized so I would not commit it to a library until that was done.

Print this item

  Jessie-> Stretch lib changes
Posted by: Brian Beuken - 03-08-2018, 07:49 AM - Forum: Raspberry Pi questions - Replies (2)

After the book was written Raspbian Stretch was released (about 2 months after I submitted it, grrr), which is a nice update to the OS, but does mean that libs have changed,

I will adapt all code to work with Stretch, if you are using old Jessie, its time to update as Jessie is now considered to be over.

sudo apt-get update
sudo apt-get upgrade
This won't give you a version of Stretch more of a bit of both worlds, (you need to burn an new SD) but it will give you all new bits you need

you can also do
sudo apt-get dist-upgrade

Which will give you a full upgrade for your current version of Jessie  but with the new static libs, and retain all your current files avoiding the need for a full reburn of the SD but with the risk of some legacy libs still in place which may not work as expected now. (though if we're honest a full reburn is the best option here)

The only major complication is that there are now some new libs to use.

  1. GLESv2_static 
  2. EGL_static 
  3. vchiq_arm 
  4. vcos
  5. khrn_static 
  6. pthread 
in place of the 2 older GLESv2 and EGL libs
pthread is actually used a lot in the book, though the 1st few projects didn't need it, but with the expanded set of libs, pthread is now required also

Print this item

  its not called Rasbian....doh!
Posted by: Brian Beuken - 03-06-2018, 01:50 PM - Forum: Fundamentals Errata/Questions - No Replies

yeah sorry, I noticed in my previews, I repeatedly misspell Raspbian as Rasbian.

If there's an update I'll make sure to fix that. My apologies to the Raspberry Pi Foundation

Print this item

  Where are the Website files - Delay, due to stupid author
Posted by: Brian Beuken - 03-06-2018, 10:51 AM - Forum: Scratchpad Games - Replies (4)

As noted in the Errata forum.

There has been a mix up over release dates, totally my fault, I was looking at the EU release date for the paperback as my deadline to get the site fully up and running, and have been busy working on my finished game examples, and cleaning and tidying up the downloadable code, planning to post it before the end of March.

Unknown to me though the Kindle version has gone on sale in the US (and maybe EU) so there are people now working on the book.

Arghhh, thats kinda thrown me.

So for the moment I am stopping the work on the final versions, to focus on getting the tidy download code on the site.

All the code is here and working, but does need to be checked and tested on post Nov17 Rasbian, and also new and old Linux kernals as there were some major updates to many systems. There were also minor changes made to the code, over the course of the book so some of the early projects may have got added to after being written, so I need to make sure they are ok and if not, are stripped back to their base levels for you to add to. 

So I'll be adding the projects a few each day, to hopefully keep up with your need to work through the kindle version. But if you get ahead of me, let me know here and I'll try to get later files ready for you to use as you need them.

I will initially post all projects as pre Nov17 Raspbian Jessie projects, so you may find you need to use 6 potentially new lib files if you have a later version of Raspbian Stretch.

  • GLESv2_static 
  • EGL_static 
  • vchiq_arm 
  • vcos 
  • khrn_static 
  • pthread

in place of the 2 older GLESv2 and EGL  libraries used pre Nov17 

(if you just updated an old version of Raspbian, you may find you have both, but best to use the new libs)

As soon as I'm done with the check/test/uploads I will add config systems to them to give post Nov17 automatically.


Then I'll provide Ubuntu, Armbian and Debian style builds, which will not be quite as reliable as there is considerable variation in distro's for Ubuntu and Debian, but you should work that out ok.


All that said, I am expecting to get everything in place before the hardcopy of the book is released, this just upset my timetable a bit, so please hang in there and let me know if I'm screwing up, I'm happy to work with you to fix any problems.

Print this item

  Where are the Website files - Delay, due to stupid author
Posted by: Brian Beuken - 03-05-2018, 10:37 AM - Forum: Fundamentals Errata/Questions - No Replies

I am so sorry, I genuinely thought the book was being released on the 22nd of March, since that was the date listed on Amazon.co.uk and have been tinkering and tidying the files to get them ready for upload.

So I was a little shocked to get a request for the files today, 5th March... 

I hadn't checked the release date for the US...which was a few weeks earlier, which means it out now, and the site is still in progress..especially the code downloads...doh

My sincerest apologies, especially as you will have activated your Visual GDB, this was a massive oversight on my part and I never thought to check if the book had staged release dates.

I'll get the 2D projects up on the Website tonight and the 3D ones in the next few days.

If you need anything urgently, just mail or post here and I'll see if I can expedite things

Print this item

  Keyboard issues
Posted by: Brian Beuken - 03-05-2018, 09:23 AM - Forum: Raspberry Pi questions - Replies (1)

The standard keyboard system I provide, is 99% effective, but I have discovered one or 2 wireless keyboards don't work. unrelated to the file lock some linux systems have, where a  sudo chmod  a+r /dev/input/* will make your event files accessible.

Usually the fix is to look at the AreYouMyKeyboard scanning method, whose job is to parse though the input systems to find the current active keyboard. Most Wired and WiFi keyboards will work perfectly with no issues, but sometimes wireless keyboards don't play nice. Usually though that can be fixed by changing the pattern to search for  from event-kdb to event-mouse.

However.....Some BT keyboards won't even work with that fix, and I don't know the exact reasons why, Raspbian do state that not all BT keyboards are compatible, but its frustrating to see your BT keyboard working on your terminal and not in your project. However there is a "fix" but its very hacky will make your code work only on your system with your keyboard.


So if you are one of those poor people with a keyboard that refuses to register, you can hack the ProcessKeyboardThread to hard wire the event that controls your keyboard, like this:

//fp = fopen(((Input *)arg)->kbd.c_str(), "r"); // normal scanned keyboard

fp = fopen("/dev/input/event1", "r"); // hacked forced event0 or event1 or... (up to max events)

I'll work on a better solution, but for now this will fix most issues.

Print this item

  PhotoFrame
Posted by: jbud70 - 03-05-2018, 01:34 AM - Forum: Fundamentals Errata/Questions - Replies (13)

Hello,

Great book.  I am enjoying it so far.

Where can I find the PhotoFrame project download referenced in Chapter 4?

Josh

Print this item