Go to advanced search

by Paeryn
Fri Dec 20, 2013 8:37 pm
Forum: OpenGLES
Topic: Trying to get GLFW to work
Replies: 5
Views: 3539

Re: Trying to get GLFW to work

Sorry I haven't got time to go into any details, documentation for dispman is scarce. The examples in /opt/vc/src/hello_pi/ on the RPi (*) contain the basic set-up code that you need - in hello_triangle/triangle.c all the dispman related code is in the function init_ogl I think, apart from the bcm_h...
by Paeryn
Thu Dec 19, 2013 11:35 pm
Forum: OpenGLES
Topic: Trying to get GLFW to work
Replies: 5
Views: 3539

Re: Trying to get GLFW to work

On the RPi the EGL window is totally separate from X11, the X server has nothing to do with it and so visual IDs won't have any relation. Instead EGL windows are handled by the RPi's display manager - dispman (the framebuffer is basically one of dispman's windows). This does mean that it you can hap...
by Paeryn
Thu Dec 19, 2013 11:00 pm
Forum: Graphics programming
Topic: -DOMX_SKIP64BIT
Replies: 2
Views: 1708

Re: -DOMX_SKIP64BIT

It's a macro define that looks like it allows the OpenMAX headers to add code to support a non-native 64-bit long long as a structure of 2 32-bit ints.
by Paeryn
Tue Dec 17, 2013 2:44 am
Forum: Graphics, sound and multimedia
Topic: tvservice -p not working correctly on dvi/hdmi
Replies: 4
Views: 2549

Re: tvservice -p not working correctly on dvi/hdmi

You just need to reset the framebuffer, easiest way is to change the depth to 32 and then back to 16 with fbset -depth 32; fbset -depth 16 Edit: If you're using X then you'll also need to tell X11 to refresh afterwards too so in that case use fbset -depth 32; fbset -depth 16; xrefresh Any program th...
by Paeryn
Mon Dec 02, 2013 11:06 pm
Forum: OpenGLES
Topic: how to v-flip vertex shader?
Replies: 13
Views: 6825

Re: how to v-flip vertex shader?

That's ok peepo, glad it's helped. I really must get myself a camera board - maybe my cats will buy me one for xmas :)

There's quite a lot to get to grips with with OpenGL, but eventually it all clicks - honest.
by Paeryn
Sun Dec 01, 2013 9:47 pm
Forum: OpenGLES
Topic: how to v-flip vertex shader?
Replies: 13
Views: 6825

Re: how to v-flip vertex shader?

I've compiled the picam program (modified to use a static image). In that program some of the images won't appear flipped when you try due to the texture mapping being applied twice. Some only get rendered once, directly from the Y, U or V channel of the camera image, Some get rendered twice, 1st fr...
by Paeryn
Sun Dec 01, 2013 1:23 am
Forum: OpenGLES
Topic: how to v-flip vertex shader?
Replies: 13
Views: 6825

Re: how to v-flip vertex shader?

tcoord.st = vec2(pos.x, 1.0 - pos.y); is very close, if not perhaps identical to one line I tried, tx for the confirmation, Paeryn ~:" I'm struggling to understand how and why this doesn't work. but will have to leave as is for now.... In what way is it not working? What happened (what did you see ...
by Paeryn
Fri Nov 29, 2013 10:07 pm
Forum: OpenGLES
Topic: how to v-flip vertex shader?
Replies: 13
Views: 6825

Re: how to v-flip vertex shader?

It looks like his code is passing vertices as going from 0,0 to 1,1 so you need to subtract the y value from 1.0. I've used tcoord.st rather than tcoord.xy, either works, it's just convention that texture coordinates are called s,t. attribute vec4 vertex; uniform vec2 offset; uniform vec2 scale; var...
by Paeryn
Fri Nov 22, 2013 2:01 am
Forum: OpenGLES
Topic: how to GLES2 Ortho Triangle?
Replies: 5
Views: 3240

Re: how to GLES2 Ortho Triangle?

I've cut the code down to minimal error-checking, vanilla C (and fixed a couple of bugs). https://www.dropbox.com/s/fzuh3lfqjmsphyw/ortho.zip It sets up an ortho projection where the vertex coords map to the pixel coords of the window. I'm guessing this might be what you want since you asked for a 2...
by Paeryn
Thu Nov 21, 2013 1:32 am
Forum: OpenGLES
Topic: how to GLES2 Ortho Triangle?
Replies: 5
Views: 3240

Re: how to GLES2 Ortho Triangle?

Is this any good? It doesn't have texturing yet, I'll expand the example later if you want it. https://www.dropbox.com/s/5yox4ysbd0uzpqr/gles2ortho.zip Sorry about the messy code - it uses some code from a project I'm working on, I think I've stripped the non-relevant stuff out. Ask away if you need...
by Paeryn
Wed Nov 13, 2013 6:45 pm
Forum: Bare metal, Assembly language
Topic: Test your compilers!
Replies: 37
Views: 7374

Re: Test your compilers!

It's not C11 (it compiles with std=c99), those errors are from not having u_int32_t and int32_t defined, they're defined in another header that <sys/types.h> includes, but you don't seem to have that. Change #include <sys/types.h> to #include "lisp2.h" as that defines them (and isn't otherwise refer...
by Paeryn
Thu Nov 07, 2013 12:31 am
Forum: Graphics programming
Topic: Which: GLES, VG or MAX
Replies: 9
Views: 2834

Re: Which: GLES, VG or MAX

do you consider the hello_pi examples a simple introduction**? **hello_triangle2 is wonderful, but perhaps hard for a novice to emulate and transform. It depends on where you are coming from, as examples of OpenGL they are quite simple, the GLES2 is harder because it doesn't provide the fixed-funct...
by Paeryn
Wed Nov 06, 2013 12:21 am
Forum: Graphics programming
Topic: Which: GLES, VG or MAX
Replies: 9
Views: 2834

Re: Which: GLES, VG or MAX

Some examples are in /opt/vc/src/hello_pi

OpenGL ES1: hello_triangle
OpenGL ES2: hello_triangle2
OpenVG: hello_tiger
OpenMAX: hello_audio, hello_encode, hello_jpeg, hello_video

Using OpenMAX to decode video into textures which are then rendered by OpenGL ES1: hello_teapot, hello_videocube.
by Paeryn
Fri Nov 01, 2013 2:31 am
Forum: OpenVG
Topic: Example program to draw random shapes using the C compiler
Replies: 72
Views: 64739

Re: Example program to draw random shapes using the C compil

sorry, I don't see the mis-spelling The file that should be named font2openvg.cpp is incorrectly named font2opencv.cpp When you download from the link given (https://gist.github.com/3196007) the four files in the archive are :- DejaVuSans.inc font2opencv.cpp Makefile shapes.c This is only in the gi...
by Paeryn
Wed Oct 30, 2013 5:19 pm
Forum: Graphics programming
Topic: EGL - How to use fb1?
Replies: 27
Views: 25948

Re: EGL - How to use fb1?

Actually, because fb0/fb1_pointer's is of type short , it is not necessary to multiply by fb1_screen_bitdepth (2) because c knows the type is short (which is 2 bytes in size). When you add 1 to a pointer it advances the size of the type (sizeof(short) = 2) in bytes. Oops, my mistake, the code I wro...
by Paeryn
Wed Oct 30, 2013 5:21 am
Forum: Graphics programming
Topic: EGL - How to use fb1?
Replies: 27
Views: 25948

Re: EGL - How to use fb1?

One solution would be to force fb0 to have the same resolution (480x272) so that no cropping or scaling would be needed and a direct copy could be used. I tried plugging in an HDMI monitor and in /boot/config.txt setting hdmi_mode=3 (480p) and hdmi_force_hotplug=1 (just in case) but the resolution ...
by Paeryn
Mon Oct 28, 2013 9:02 pm
Forum: OpenMAX
Topic: Accessing OpenMax library
Replies: 3
Views: 2440

Re: Accessing OpenMax library

They aren't system header files so you should be enclosing the names in double-quotes rather than angle-brackets e.g. #include "bcm_host.h" And you need to tell the compiler where to find them by adding the following to your compile flags (they should be in /opt/vc/include) -I/opt/vc/include -I/opt/...
by Paeryn
Mon Oct 28, 2013 5:11 am
Forum: Graphics programming
Topic: Importing OpenGL ES Libraries in C/C++ Project
Replies: 3
Views: 14423

Re: Importing OpenGL ES Libraries in C/C++ Project

The code you gave is vanilla C, but is equally valid C++ You need to tell the compiler where to find the GLES and EGL include directories. They usually live in /opt/vc/include so your compile line would need to be something like gcc -c -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/o...
by Paeryn
Sat Oct 26, 2013 3:27 am
Forum: Graphics programming
Topic: EGL - How to use fb1?
Replies: 27
Views: 25948

Re: EGL - How to use fb1?

I would guess something along the lines of, the read request locking the resource that holds the screenshot and fails to free it when the read fails. The next screenshot request could then be sat waiting for the resource to be unlocked. I tried the fbcp program (again changing it to use to fb0), it ...
by Paeryn
Fri Oct 25, 2013 11:14 pm
Forum: Bare metal, Assembly language
Topic: Memory Bank Control Registers
Replies: 13
Views: 2634

Re: Memory Bank Control Registers

An MPU (Memory Protection Unit) allows defining areas of memory with various attributes such as whether it can be accessed from user mode or only in privileged mode, and also whether the memory area is cacheable or not. It isn't able to translate virtual memory addresses into physical memory address...
by Paeryn
Fri Oct 25, 2013 2:54 pm
Forum: Graphics programming
Topic: EGL - How to use fb1?
Replies: 27
Views: 25948

Re: EGL - How to use fb1?

Everything worked start ret1: 0 middle ret2: -1 end start And then it hangs forever. So on the first loop I see the cube on fb0 but no change to fb1 and vc_dispmanx_resource_read_data returns -1. On the second loop it hangs on vc_dispmanx_snapshot. I noticed that when trying to use glReadPixels it ...
by Paeryn
Thu Oct 24, 2013 6:21 pm
Forum: Graphics programming
Topic: EGL - How to use fb1?
Replies: 27
Views: 25948

Re: EGL - How to use fb1?

Hmm... So you are saying it is impossible for egl to use fb1. I wonder why they would implement that restriction. I won't pretend to remotely understand what goes on at that level. Yes, EGL on the RPi doesn't use the linux framebuffers at all , not fb1 nor fb0. The graphics hardware works at a high...
by Paeryn
Wed Oct 23, 2013 10:44 pm
Forum: Graphics programming
Topic: EGL - How to use fb1?
Replies: 27
Views: 25948

Re: EGL - How to use fb1?

The opengl output isn't drawn into the linux framebuffers, it's drawn into an entirely separate layer which is composited by the Pi's internal display manager together with any other layers (of which fb0 is one such layer) to generate the image which is shown. On the RPi there is only one display. T...
by Paeryn
Wed Sep 18, 2013 10:43 am
Forum: OpenGLES
Topic: Is it mandatory to have attributes in vertex shader?
Replies: 2
Views: 1912

Re: Is it mandatory to have attributes in vertex shader?

Where are you putting the attribute ? attribute is used to pass per-vertex data to the vertex shader and cannot be written to from within the shader. The in and out qualifiers in opengl es2 only apply to function parameters. To pass a variable from the vertex shader to the fragment shader it needs t...
by Paeryn
Sat Sep 07, 2013 5:21 pm
Forum: Gaming
Topic: A new device that is intriguing
Replies: 12
Views: 2344

Re: A new device that is intriguing

£30 for one die? You could buy several physical board games for less.

I can just see, when halfway through a game, the battery runs out. "Tea break whilst we recharge the Dice+"

Go to advanced search