Go to advanced search

by DarkElvenAngel
Sun Nov 10, 2019 10:48 pm
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 13
Views: 2535

Re: Best way to handle sprites

I'm thinking a double buffer might be the only approach to solve this issue of background changing. A buffer for the background that is copied to the main frame buffer then apply the sprites over that and use this background buffer in place of the small working buffer. This will require more memory....
by DarkElvenAngel
Sun Nov 10, 2019 9:02 pm
Forum: Advanced users
Topic: Seperate framebuffers for each HDMI
Replies: 13
Views: 1926

Re: Seperate framebuffers for each HDMI

Which leave using legacy graphics mode. This will instantiate a framebuffer for each attached device, but you will lose 3D acceleration, and hence desktop speed. Comment out the fkms line in config.txt. Thanks for that it works perfectly, now I have X on my main screen and access to the framebuffer...
by DarkElvenAngel
Sun Nov 10, 2019 1:38 am
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 13
Views: 2535

Re: Best way to handle sprites

blackshard83 wrote:
Sat Nov 09, 2019 11:44 pm
Of course that's an approach, but it will work well only if your "background" does never change.
I see that could be a problem since it's very possible that the background could change, how do I deal with that?
by DarkElvenAngel
Sun Nov 10, 2019 1:28 am
Forum: Advanced users
Topic: Seperate framebuffers for each HDMI
Replies: 13
Views: 1926

Seperate framebuffers for each HDMI

Hello all, Finally got my raspberry Pi 4 and a DVI to HDMI converter so now I have dual screens, I thought this would give me two framebuffers. I was hoping to have X run on my primary monitor and be able to Have something else on the other. I have the max_framebuffer option set to 2 is there someth...
by DarkElvenAngel
Sat Nov 09, 2019 5:34 pm
Forum: Graphics programming
Topic: Best way to handle sprites
Replies: 13
Views: 2535

Best way to handle sprites

Hello, I'm working on a raw Linux Framebuffer library and I'm thinking to add sprites if for nothing else I can use it for a mouse cursor. I'm writing all this is C and I'm not sure how it should work. My current thinking is to take a rectangle from where the sprite will be placed and save that in a...
by DarkElvenAngel
Thu Nov 07, 2019 12:14 am
Forum: C/C++
Topic: Searching for Algorithms
Replies: 5
Views: 1432

Re: Searching for Algorithms

The more modern way is to simply approximate circles and arcs using bezier routines, if exact accuracy is not required. If you look at Windows API for example it doesn't even contain a conventional arc routine it uses start and end point with bounding box https://docs.microsoft.com/en-us/windows/wi...
by DarkElvenAngel
Wed Nov 06, 2019 12:02 pm
Forum: C/C++
Topic: Searching for Algorithms
Replies: 5
Views: 1432

Re: Searching for Algorithms

How could you not find Bresenhams Circle Drawing Algorithm in the page of results: https://iq.opengenus.org/bresenhams-circle-drawing-algorithm/ Or this for ellipses, including example C source: https://www.geometrictools.com/Documentation/IntegerBasedEllipseDrawing.pdf And see here: https://en.wik...
by DarkElvenAngel
Wed Nov 06, 2019 3:09 am
Forum: C/C++
Topic: Searching for Algorithms
Replies: 5
Views: 1432

Searching for Algorithms

Hello All, I'm trying to track down some algorithms for drawing arcs. All I keep finding is references to graphics.h for DOS and TurboC! I'm working on my framebuffer UI library and have most shapes I need except for arcs and ellipses (I've found the mid point algorithm for that) just have not imple...
by DarkElvenAngel
Thu Oct 31, 2019 7:55 pm
Forum: Other projects
Topic: Halloween HMI
Replies: 1
Views: 714

Halloween HMI

Halloween is upon us once again, And this year I have made something with raspberry Pi, an HMI or Human Machine Interface. It consists of a Raspberry Pi 3B+ the official touch screen all in a smarty pi casefor the master. And I have a Pi 0W and a custom board for a wireless remote. I'm running custo...
by DarkElvenAngel
Tue Oct 29, 2019 3:14 am
Forum: Media centres
Topic: Turn Raspberry Pi on/off with TV
Replies: 13
Views: 5769

Re: Turn Raspberry Pi on/off with TV

Post your code, it's easier to help you if I can see it.
by DarkElvenAngel
Mon Oct 28, 2019 4:56 pm
Forum: General discussion
Topic: Show splash screen ASAP
Replies: 124
Views: 13426

Re: Show splash screen ASAP

Did you try the guide I posted? That will get a splash image in much faster than Plymouth. You can use an initramfs to display an image within 1-2 seconds after boot. Depending on your setup and needs you can do away with Plymouth. I have an older guild to achieve this here https://www.raspberrypi.o...
by DarkElvenAngel
Sun Oct 27, 2019 6:52 pm
Forum: Media centres
Topic: Turn Raspberry Pi on/off with TV
Replies: 13
Views: 5769

Re: Turn Raspberry Pi on/off with TV

It turns out that a monitor plugged into the HDMI port is required for the gpio-shutdown overlay to work. I did some testing today, and moved my RPi into the living room and connected it to my TV, then it worked fine. I then shut it down, disconnected the monitor, and tried again, and it worked fin...
by DarkElvenAngel
Sun Oct 27, 2019 1:10 am
Forum: Media centres
Topic: Turn Raspberry Pi on/off with TV
Replies: 13
Views: 5769

Re: Turn Raspberry Pi on/off with TV

Well I'm running kernel 4.19.57-7v+

And my config.txt entry reads

Code: Select all

dtoverlay=gpio-shutdown
I have the button connected to the gpio header and I press it and it shuts down.

Gpio header

Code: Select all

::|:::::::::::::::::         [USB PORTS
  ^ power button across here 5 and 6
by DarkElvenAngel
Sat Oct 26, 2019 5:46 pm
Forum: Media centres
Topic: Turn Raspberry Pi on/off with TV
Replies: 13
Views: 5769

Re: Turn Raspberry Pi on/off with TV

I can't make that overlay work... https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=254003 /Mogens I never had any trouble getting that overlay working in stretch with my Pi3B+ you don't need to tell it what pin to use though. I use this on a stretch lite running Kodi and I added this ove...
by DarkElvenAngel
Wed Oct 23, 2019 2:21 am
Forum: C/C++
Topic: UART packet sending woes.
Replies: 4
Views: 1317

Re: UART packet sending woes.

I've been messing about with UART recently trying out the Firmata protocol basically MIDI messages. There is a github repository https://github.com/jdourlens/FirmataC this has a very good serial implementation with modification and clean up I think it could work. I have used it successfully to send ...
by DarkElvenAngel
Tue Oct 22, 2019 3:50 am
Forum: Beginners
Topic: Screen, hats and cases
Replies: 1
Views: 426

Re: Screen, hats and cases

If you're using the official RPI Touch Screen then yes there is.

https://smarticase.com/products/smartipi-touch-2

I have the original case and it's great, I should think you would have no problems getting everything in there.
by DarkElvenAngel
Thu Oct 17, 2019 1:25 pm
Forum: C/C++
Topic: Best way to wait on an event
Replies: 17
Views: 2234

Re: Best way to wait on an event

What else is your program doing when at idle? 20% load for doing nothing is huge! It's not 20% at idle, the idea was to out perform my previous attempts when I used pygame my CPU load was so high I needed to add heatsinks, then I discovered RayLib that brought it down to 40%, and that was fine for ...
by DarkElvenAngel
Thu Oct 17, 2019 12:21 pm
Forum: C/C++
Topic: Best way to wait on an event
Replies: 17
Views: 2234

Re: Best way to wait on an event

It's different I only draw the whole screen once from there it's only small areas that get updates, like for a button press or if a sensor changes state. I don't have a render buffer just the frame buffer. I'm not dealing with alpha transparency other wise I would want some extra buffers deal with t...
by DarkElvenAngel
Wed Oct 16, 2019 7:55 pm
Forum: C/C++
Topic: Best way to wait on an event
Replies: 17
Views: 2234

Re: Best way to wait on an event

Heater,
Yes Frames per second, RayLib is for games and animation and that's one method they use to poll events. I use usleep to and wait for events to come in and then update accordingly. My application is a simple HMI no animations.
by DarkElvenAngel
Wed Oct 16, 2019 5:32 pm
Forum: C/C++
Topic: Best way to wait on an event
Replies: 17
Views: 2234

Re: Best way to wait on an event

For my UI I'm running the touch input in a thread and it will push events to a cue. As for the main loop I use a usleep to maintain a lower CPU load and keep checking the cue for input events then process them as they come in. Take a look at RayLib they do something similar to maintain a set FPS but...
by DarkElvenAngel
Fri Oct 04, 2019 2:04 pm
Forum: C/C++
Topic: Help loading PNG image to frame buffer
Replies: 11
Views: 2749

Re: Help loading PNG image to frame buffer

I've been playing around with Buildroot root and I complied the kernel with a splash to clear up all the boot messages but with this I can make my own bootsplash program, that doesn't rely on external libraries. That's exactly what I'm doing reading directly from "/dev/input/event0" it's a...
by DarkElvenAngel
Fri Oct 04, 2019 1:11 pm
Forum: C/C++
Topic: Where can I begin learning C/C++?
Replies: 84
Views: 11523

Re: Where can I begin learning C/C++?

And what about learning modern c++ style? Do you have any resource to learn the new features of the lenguage? If you're asking me I started a thread asking about that, C++ and where to start learning. if you don't know C Programming you'll have a harder time of it. There was a video introduction on...
by DarkElvenAngel
Thu Oct 03, 2019 6:15 pm
Forum: C/C++
Topic: Help loading PNG image to frame buffer
Replies: 11
Views: 2749

Re: Help loading PNG image to frame buffer

You are making hard work of it ... it's actually quicker to code it for you https://github.com/LdB-ECM/bmp_on_linux The actual 200 lines of code is here https://github.com/LdB-ECM/bmp_on_linux/blob/master/main.c My makefile turns that into bmplinux.cmd which is a linux executable. The bitmap file i...
by DarkElvenAngel
Thu Oct 03, 2019 2:41 pm
Forum: C/C++
Topic: Where can I begin learning C/C++?
Replies: 84
Views: 11523

Re: Where can I begin learning C/C++?

I would start with C and then move to C++

This book was great as an introduction

Mike McGrath
C Programming in easy steps

Also these videos on YouTube were great
https://www.youtube.com/playlist?list=P ... fwEGES2oIW
by DarkElvenAngel
Thu Oct 03, 2019 1:25 pm
Forum: C/C++
Topic: Help loading PNG image to frame buffer
Replies: 11
Views: 2749

Re: Help loading PNG image to frame buffer

> 32bpp > It is unclear how the 4 bytes per pixel are used, if you could attach screenshot and matching framebuffer content as requested before, I could tell. I would install netpbm tools, and convert .png to .pnm with pngtopnm tool. Binary color .pnm (portable anymap) is easy to read in (P6 mode):...

Go to advanced search