Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / [LOCKED] i need split screen code

Author
Message
lllll venom lllll
12
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 27th Dec 2011 06:53
im going to make two player fps kinda like call of duty world at war and i cant find the code or figure it out how to split screen and have two cameras set on each side of the map any bodey know how to code this split screen?

envy
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 27th Dec 2011 14:41
well you can make a thing called buffer
and make 2 buffers, one for player 1 and other for player 2

then when dbSync() before that you need to apply the buffers to the screen just like sprites..

I never used on DarkGDK but in allegro i worked with that

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 27th Dec 2011 16:37
Or you can check out the cameras example that came with Gdk. Set up two cameras, pointing at their respective points in the world...

JTK
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Dec 2011 16:47
Use two cameras. You already have camera 0, just dbMakeCamera(1)
dbSetCameraToImage ( int iCamera, int iImage, int iWidth, int iHeight ) for the two cameras. This will make the cameras render to two seperate images that you can then place on the screen. The problem is that you can only have one camera active at a time, so your max frame rate is essentially cut in half--but for most machines this will be negligible.

dbMakeCamera(1);
dbSetCameraToImage(0,Cam0Image,ScreenW/2,ScreenH);
dbSetCameraToImage(1,Cam1Image,ScreenW/2,ScreenH);
dbSyncMask(1 << 1);//to set the scene to render to camera 1
dbSetCurrentCamera (1);//I'm not sure this is needed, but I use it
dbFastSync();

.... then do the same with camera 0

dbSyncMask(1 << 0);//to set the scene to render to camera 0
dbSetCurrentCamera (0);//I'm not sure this is needed, but I use it
dbFastSync();

.... then paste the images side-by-side
dbPasteImage(Cam0Image,0,0);
dbPasteImage(Cam1Image,ScreenW/2,0);
dbSync();

.....I assume you know the setup for this. I only gave the code pertaining to your question.

The fastest code is the code never written.
lllll venom lllll
12
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 27th Dec 2011 21:56
no that code didnt work just like i figured dous any one have the code to do this please help?

envy
Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 28th Dec 2011 00:07
Quote: "no that code didnt work just like i figured dous any one have the code to do this please help?"

Have you tried doing this yourself? We can't know what specific requirements your game would require.

Since you said you tried the code that Hawkblood gave, can we see how that code looks like in your program?

Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 28th Dec 2011 01:08
Quote: "no that code didnt work just like i figured dous any one have the code to do this please help?"

Once again, we won't hand you code that you can just use. We provide help and examples, these examples help you learn how to do it yourself. You won't get anywhere by copy pasting other peoples code.
lllll venom lllll
12
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 28th Dec 2011 01:30 Edited at: 28th Dec 2011 01:30
ok ill by magic pull code out my *** cous i programed dark gdk so i already know all the code so i can just take his code and make it work o thats right i already know it so i dont need his code or learn any thing kinda like u mr bigglesworth ur the biggest copy andd paster oviously cous if not then that means u programed dark gdk u noob programers are hilarious.mr pickles or biggles or whatever ur name is id program circles around u ya little copy and paster.

envy
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 28th Dec 2011 02:05
I'm not even going to warn you venom, as you've been banned for this type of behavior before. So have fun on your vacation.

JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 28th Dec 2011 02:05
Flame

This thread has been locked due to the unmanageable number of flame responses. Please refer to section 3.11 - 3.12 of the Acceptable Usage Policy for full details:

http://www.thegamecreators.com/?gf=aup#forum

AUP Section 3.17 ...Moderators shall, at their discretion, determine what constitutes a violation of these terms, along with generally accepted netiquette standards, and can take action against those who violate these rules.

If you contributed to the reason for locking, you may now find yourself on moderation, or in extreme cases a ban.

Login to post a reply

Server time is: 2024-10-02 21:35:40
Your offset time is: 2024-10-02 21:35:40