Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 103
» Latest member: yelruh
» Forum threads: 233
» Forum posts: 989
Full Statistics
|
Online Users |
There is currently 1 user online » 0 Member(s) | 1 Guest(s)
|
Latest Threads |
Is Vulkan the future?
Forum: General Chat
Last Post: web2gamedevconvert
07-07-2024, 12:29 PM
» Replies: 8
» Views: 18,671
|
hello
Forum: Scratchpad Games
Last Post: web2gamedevconvert
05-20-2024, 04:20 PM
» Replies: 10
» Views: 31,252
|
So, you're bypassing Unit...
Forum: General Chat
Last Post: web2gamedevconvert
05-18-2024, 10:34 AM
» Replies: 3
» Views: 15,213
|
Arise dead book?
Forum: Scratchpad Games
Last Post: Brian Beuken
02-29-2024, 08:07 AM
» Replies: 0
» Views: 1,140
|
Im working on a Game..
Forum: Scratchpad Games
Last Post: Brian Beuken
08-04-2023, 10:58 AM
» Replies: 8
» Views: 18,711
|
OpenGL Error handling
Forum: Assets, Tools, Libraries and other useful things
Last Post: Brian Beuken
12-07-2022, 11:48 AM
» Replies: 0
» Views: 5,790
|
Rock Pi5B
Forum: Other SBC's
Last Post: Brian Beuken
11-12-2022, 10:14 PM
» Replies: 5
» Views: 11,910
|
Setting Up Bullet
Forum: Assets, Tools, Libraries and other useful things
Last Post: Brian Beuken
10-12-2022, 11:36 AM
» Replies: 3
» Views: 14,642
|
Building with a toolchain
Forum: General Chat
Last Post: junglie85
09-11-2022, 07:45 AM
» Replies: 3
» Views: 11,698
|
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: 10,206
|
|
|
Google Coral Dev Board |
Posted by: jomoengineer - 04-21-2019, 04:31 AM - Forum: Other SBC's
- Replies (1)
|
|
The NVIDA Jetson Nano appears to have a competitor from Google.
The Google Coral Dev Board
https://coral.withgoogle.com/products/dev-board
It's available from Mouser or Seeed at $149.00 US
The Coral comes with on board WiFi and Bluetooth 4.1 where as the Jeson Nano does not, however for $25US you can add a WiFi/BT 4.2 M.2 Module to the Nano.
Like the Nano, the Coral comes in a SoM which is based on the NXP's iMX8M system-on-chip (SOC) with:
- Quad symmetric Cortex-A53 processors:
- Support of 64-bit Armv8-A architecture
- Arm Cortex-M4 core platform
- Vicante GC7000 lite graphics GPU (OpenGL ES 3.1 support)
- Two PCI Express Gen2 interfaces
And other goodies.
I would like to have one to test drive but not looking to pay for it yet.
|
|
|
Can't install on Ubuntu? |
Posted by: Brian Beuken - 04-14-2019, 01:18 PM - Forum: Help my code won't work??
- No Replies
|
|
Depending on the version of ubuntu you may come accross this error when trying to install bullet or mesa libs
Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
This is nearly always caused by the Ubuntu updater being active in the background, which is the other process it's asking about, and doing exactly what its designed to. Unfortunately while its doing it, there's nothing you can really do, it has a priority over the directories while its in progress.
On the 1st run, the updater is downloading and installing any updates, so you just have to wait for it. Once its done (this can take up to an hour), you can usually go to your system updater via the System->Administration->Software Updater and switch off the auto updates.
Annoyingly you can't switch them off if an update has alrady started.
|
|
|
Start without debugging error chp 4 |
Posted by: bergj - 04-11-2019, 03:20 PM - Forum: Help my code won't work??
- Replies (1)
|
|
When I start the project (your code from the code download page) without debugging it says "failed to load" and glGetError 0x501. When I start with debugging it runs fine and loads the images. Why is this? Going forward, am I supposed to always run with debugging?
|
|
|
Using Extensions |
Posted by: Brian Beuken - 03-25-2019, 03:39 PM - Forum: Assets, Tools, Libraries and other useful things
- Replies (1)
|
|
I generally don't use many extensions, but now that we're getting into OpenGLES3.0 its important to make use of them, and they can be confusing.
I just tried to use some on Raspberry and discovered some interesting issues, namely a missing lib called libdl which needs to be added if you are going to use extensions on a current Raspberry. Not sure about other boards as I don't have one set up, but if you get a link error add dl
Using an extension requires that you set it up first and that is the first minefield, you can of course list the extensions your system supports using somethng like
printf("This GPU supports these extensions :%s\n", glGetString(GL_EXTENSIONS));
Which will give you a nice list of "extensions" for a Raspberry like this.
This GPU supports these extensions :GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_texture_npot GL_OES_depth24 GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_discard_framebuffer GL_OES_rgb8_rgba8 GL_OES_depth32 GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_APPLE_rgb_422 GL_EXT_debug_marker
I put "extensions" in quotes becuase these are not the names of the functions but rather a grouping for the extensions actually available.
This is a mix, some of these extensions are types, and some are functions. The types we don't care too much about just adding #include <GLES2/gl2ext.h> will give us access to the types that are associated with that name....for example "extension" GL_OES_rgb8_rgba8
Code: * GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_RGB8_OES 0x8051
#define GL_RGBA8_OES 0x8058
#endif
Gives us, 2 new defines that are associated with calls that set up RGBA. We can define types just by adding the GL2Ext.h file.
You may have to define the type in your pre-processor but I've not noticed it. It tends to set them all up these days, so be sure you use them in the correct functions.
Functions are a bit harder. Depending on your system and the current version of the drivers it has, you have to interrogate the system to get the addresses of the functions, and you also have to create alias values for them.
The Raspberry does not have a lot of extension functions but lets look at one as an example
GL_OES_mapbuffer
If we look in the GL2ext.h file for this we find
Code: /* GL_OES_mapbuffer */
#ifndef GL_OES_mapbuffer
#define GL_OES_mapbuffer 0
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params);
#endif
typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params);
#endif
Which is a bit confusing.. but what that extension is telling us is that there are 3 functions that relate to it, called. glMapBufferOES glUnmapBufferOES and glGetBufferPointervOES
What we want to do now is create 3 alias functions, called glMapBuffer glUnmapBuffer and glGetBufferPointerv
We can leave the OES if we want but tradition states we remove it, Now notice the typedef, and you can also see that the 3 functions return very different types. void*, GLboolean and void.
and there is somehing called a PFNLGL XXXXXXX PROC where XXXXXXX is replaced by the name of the function..(in caps) That will internally define what the signature of the function is going to be and ensure we get the right result back from the function. As well as setting up what values are passed.
This is a clunky system but it is how we can create a function and send and receive the expected values.
We need to define our function in an accessable space, I tend to use my graphic class since graphics are most likely to use extensions So if you need to use these outside of graphic routines, make sure you can access the class.
PFNGLMAPBUFFEROESPROC glMapBuffer = NULL;
So we've made that..now we have to load it with the address of the function...which is something EGL does for us with a standard function Again set this up in the graphic class init.
glMapBuffer = (PFNGLMAPBUFFEROESPROC)eglGetProcAddress("glMapBufferOES");
And now glMapBuffer is available
eglGetProcAddress asks the OpenGLES2 libs if it has a function called glMapBufferOES and of course it has. (it will return null otherwise) So now we can use glMapBuffer as a function like this.
unsigned char* framedata = (unsigned char*)glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES);
Now the function can work as if it is a standard gl function, and GL_WRITE_ONLY_OES is activated as part of its types it needs.
(now, there does seem to be a few issues with mapbuffer on raspberry, but this example still stands on how to make and use an extension)
Each extension has its own PFNGLXXXXXXXPROC make sure you define your alias with that specific typedef and though you can use any name at all, keeping the name of the function with or without the makers value is a good plan to keep it readable.
There a good explanation here https://community.nxp.com/docs/DOC-101502
If you are going to use extensions, then it means you can only be certain that your code may only run on the same systems you build it on. That means you need to be careful if running on a similar, or older, or ever newer machine to check that the extension is available, if not you need to either not use that function, or use a different method. Never assume that becuase a Raspberry has a function, that an Odroid or a Nano Pi also has it.. Make sure when you use an extension to provide an alternative. Preferably not a crash
Here's some useful info on extension being available. though this is for windows so uses wgl not egl and talk of nvidia is a bit optomistic for SBC's
|
|
|
Intellisense issues |
Posted by: Brian Beuken - 03-18-2019, 12:29 PM - Forum: Getting started
- Replies (9)
|
|
Oh this is a good one, one of my students was struggling with lots of errors being tossed out that it could not find GLuint or glm. It appearred to be unable to find the files and associated variable types.
This in part was true, however it was Visual Studio's intellisense that was getting things mixed up and in his case he had a genuine minor code error, which resulted in a failure to compile. His error list however was throwing up all the cannot find file issues and he assumed that there was some issue there and didn't get into his code
So his true minor error, was hidden under dozens of other errors, which in fact were not errors, but reports from intellisense. scary.
The error itself was highlighted clearly in his compiler output window, since it reported the compilers issues, which is better to check than the error window which reports visual studios issues, including intellisense. You can filter just the build errors though.
The reasons for this are somewhat annoying. When you set up a connection to a Pi, or other linux system it is supposed to syncronise the files on the Pi and keep copies of the include files on your Pc to allow intelisense to work, but the connection manager only loads the usr directory....which excludes any addition directories, like bullet or glm as well as some directories unique to Raspbian, such as opt/vc/include which is where GLES2 lives...... so these files appeared to be unreachable and unloadable to VS2017. But when sent to the target to compile they happyily find the directories where we say they are in the directory lists sent with the make file
The sync really should pull in all directories used by the project, so this is an error in the system I will report to Microsoft, perhaps its been fixed in VS 2019. I will review the preview copy
Microsoft do suggest you copy other folders manually, but really its not an obvious fix and I hope they can correct this to allow for an automatic update, like VisualGDB does
https://docs.microsoft.com/en-us/cpp/lin...ew=vs-2017
|
|
|
Page 94 is different from 95 Names[i] |
Posted by: Brian Beuken - 03-16-2019, 04:04 PM - Forum: Fundamentals Errata/Questions
- No Replies
|
|
Hmm yes it is, most of the code in those pages is descriptive rather than code you have to expressly type in.. I see now (from my student Kim who's struggling a bit) that its obvious to an experienced coder but not a very new coder.
So, my bad, for not being as clear as I need to be.
At the start of the discussion on page 94, I'm using a constructor like this
Aliens::Aliens(char*, MyFiles*);
Where the char* passed would be an entry from the Names[] array.
But by the bottom of 95 I am using Aliens(int, MyFiles*)
where I am only passing the i rather than the full string in names. I wrote a different constructor which then used the array...I'll change that back to avoid confusion.
That was me optimising the code a little later and pasting in the new version, but either way, here's a bit of advice, don't slavishly type in the code, there's intended to be a little room for you to adapt it to your needs, which is great if you know C++, but clearly very confusing if its all new to you. I'm sorry about that but I have said before this is not a book for absolute beginners.
Use which ever method you want, I expect you to write your constructors and call them as you choose, I've detailed both ways but not shown all the code. I'll review that though and make sure I only show one working way, so that beginners don't get confused and expect both constructor calls to work with only 1 type of constructor.
Also you don't need to create an AlienList I'm simply explaining how we "could" use arrays to hold our enemies, but we'd end up needing multiple arrays for different things, which leads us on to using a MyObjects vector to hold, almost all of them...
A lot of the books source code from Chapter5 on, is there to be descriptive and is mostly incomplete, sometimes partially lifted from source code, you should have the C++ skills to evaluate it and fill in a few blanks or change a few bits to suit what you are doing.
But if anything isn't clear, please just let me know I'm always happy to explain and push you pass a confusion roadblock, all beginners get them and I'm happy to help.
|
|
|
|