Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 02:31 17 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Framebuffer copies entire screen worth?

Author Message
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 04:28pm 23 Nov 2020
Copy link to clipboard 
Print this post

Hey gang,

Looking to make a little 2 person racing game with split screen - player 1 top, player 2 bottom.

I was thinking I could use a Framebuffer to set up the map, copying in various tiles from the track tileset to build up a map larger than the screen, and then was hoping I could use windows to copy just a portion over to the upper or lower sections of a page based on where Player 1 or PLayer 2 are on the map (their view will be centered on their car at all times).


It seems like the Framebuffer window will only copy an entire screen's worth, not a subset of that.

Should I use Blitter instead?  Can you use blitter on a framebuffer to then copy to a page?

Bsaically I want:

Framebuffer = whole map, larger than 1 screen

page#1 - my screen buffer where I build up the next frame and I want it split like this:


------------------
|                |
|    P1 view     |     - which is a small subset portion of the framebuffer
------------------
|                |
|    P2 view     |     - which is a different subset portion of the framebuffer
------------------




Edit:

Am I correct in assuming that I can just set up the framebuffer and build up the big track map in that, then use the BLIT READ and BLIT WRITE to copy from the framebuffer and past into the upper or lower portion of the page I want to build up the player's views on?
Edited 2020-11-24 02:34 by mkopack73
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8563
Posted: 06:57pm 23 Nov 2020
Copy link to clipboard 
Print this post

  Quote  Am I correct in assuming that I can just set up the framebuffer and build up the big track map in that, then use the BLIT READ and BLIT WRITE to copy from the framebuffer and past into the upper or lower portion of the page I want to build up the player's views on?


yes, but unless you need to re-write the same information multiple times just use BLIT rather than READ/WRITE

Basically BLIT and FRAMEBUFFER WINDOW do exactly the same thing except that when I know the whole page is being overwritten I can optimise the transfer slightly more efficiently
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 10:38pm 23 Nov 2020
Copy link to clipboard 
Print this post

Wrote a test program and seem to have it working (although I need to mess with the size of the 2 windows onto the framebuffer I’m blitting over. )
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024