Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Passing null to a declare (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: over the net player animation
Next thread: Re: realbasic-games Digest, Vol 10, Issue 23


[ANN] Preview of RBD 2.4   -   Marc Zeedar
  Passing null to a declare   -   Asher Dunn
   Re: Passing null to a declare   -   Aaron Ballman
   Re: Passing null to a declare   -   Asher Dunn
   Re: Passing null to a declare   -   Frank Condello
   Re: Passing null to a declare   -   Asher Dunn

Passing null to a declare
Date: 30.01.05 21:26 (Sun, 30 Jan 2005 15:26:16 -0500)
From: Asher Dunn
The wglCreateContext function takes a parameter of type HDC (integer in
RB, right?). I can get HDCs with the GetDC function, which takes a
HWND. I can get a window's HWND with its handle property.
So to create an OpenGL context in a window, I just have to say:

wglCreateContext(getDC(theWindow.handle))

Now, Microsoft's documentation for GetDC states that you can get the
HDC of the screen by passing NULL to GetDC. Theoretically, this would
allow me to create a fullscreen context by saying:

wglCreateContext(getDC(null))

My question is, how do I pass NULL? Do I just pass 0? Do I have to pass
an empty 4 byte memoryBlock?

Asher Dunn
--------------------------------------------------------
President and Head Developer of Fireye Software
<http://www.fireyesoftware.com/>
Make PDFs from your RB app
<http://www.fireyesoftware.com/code/pdfclasses/>
AIM and Yahoo: fireye7517
REALbasic 5.5.3 Mac OS X 10.3.7

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Passing null to a declare
Date: 30.01.05 21:27 (Sun, 30 Jan 2005 14:27:41 -0600)
From: Aaron Ballman
> My question is, how do I pass NULL? Do I just pass 0? Do I have to
> pass an empty 4 byte memoryBlock?

Declare the parameter as an Integer and pass 0. Passing a MemoryBlock
that's nil will cause a NilObjectException, and passing one that's
non-nil will pass a non-nil memory address to the declare.

HTH!

~Aaron

Re: Passing null to a declare
Date: 30.01.05 21:32 (Sun, 30 Jan 2005 15:32:45 -0500)
From: Asher Dunn

On Jan 30, 2005, at 3:27 PM, Aaron Ballman wrote:

>> My question is, how do I pass NULL? Do I just pass 0? Do I have to
>> pass an empty 4 byte memoryBlock?
>
> Declare the parameter as an Integer and pass 0. Passing a MemoryBlock
> that's nil will cause a NilObjectException, and passing one that's
> non-nil will pass a non-nil memory address to the declare.

Hmm. That's what I've done, but it didn't create a fullscreen context
:-(
It just created a normal windowed context, although how it knew which
window to create the context in is beyond me.

Asher Dunn
--------------------------------------------------------
President and Head Developer of Fireye Software
<http://www.fireyesoftware.com/>
Make PDFs from your RB app
<http://www.fireyesoftware.com/code/pdfclasses/>
AIM and Yahoo: fireye7517
REALbasic 5.5.3 Mac OS X 10.3.7

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Passing null to a declare
Date: 30.01.05 21:46 (Sun, 30 Jan 2005 15:46:22 -0500)
From: Frank Condello
On 30-Jan-05, at 3:32 PM, Asher Dunn wrote:

> On Jan 30, 2005, at 3:27 PM, Aaron Ballman wrote:
>
>>> My question is, how do I pass NULL? Do I just pass 0? Do I have to
>>> pass an empty 4 byte memoryBlock?
>>
>> Declare the parameter as an Integer and pass 0. Passing a
>> MemoryBlock that's nil will cause a NilObjectException, and passing
>> one that's non-nil will pass a non-nil memory address to the declare.
>
> Hmm. That's what I've done, but it didn't create a fullscreen context
> :-(
> It just created a normal windowed context, although how it knew which
> window to create the context in is beyond me.

I don't much much about WGL, but I don't think there's a "fullscreen"
mode like on the Mac. You always attach the context to a window, and
make the window fullscreen (changing resolution and depth before
creating the window).

This may help:
<http://nehe.gamedev.net/data/lessons/lesson.asp?lesson>

Frank.
------------
Open Source RB Plugins and Classes
<http://developer.chaoticbox.com>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Passing null to a declare
Date: 30.01.05 21:50 (Sun, 30 Jan 2005 15:50:00 -0500)
From: Asher Dunn

On Jan 30, 2005, at 3:46 PM, Frank Condello wrote:

> On 30-Jan-05, at 3:32 PM, Asher Dunn wrote:
>
>> On Jan 30, 2005, at 3:27 PM, Aaron Ballman wrote:
>>
>>>> My question is, how do I pass NULL? Do I just pass 0? Do I have to
>>>> pass an empty 4 byte memoryBlock?
>>>
>>> Declare the parameter as an Integer and pass 0. Passing a
>>> MemoryBlock that's nil will cause a NilObjectException, and passing
>>> one that's non-nil will pass a non-nil memory address to the
>>> declare.
>>
>> Hmm. That's what I've done, but it didn't create a fullscreen context
>> :-(
>> It just created a normal windowed context, although how it knew which
>> window to create the context in is beyond me.
>
> I don't much much about WGL, but I don't think there's a "fullscreen"
> mode like on the Mac.

Oh :-(

> You always attach the context to a window, and make the window
> fullscreen (changing resolution and depth before creating the window).

Of course, but I was trying to do it the "official" way.

> This may help:
> <http://nehe.gamedev.net/data/lessons/lesson.asp?lesson>

OK, I'll take a look at lesson 1. It's been a while since I looked at
NeHe's lessons ;-)

Asher Dunn
--------------------------------------------------------
President and Head Developer of Fireye Software
<http://www.fireyesoftware.com/>
Make PDFs from your RB app
<http://www.fireyesoftware.com/code/pdfclasses/>
AIM and Yahoo: fireye7517
REALbasic 5.5.3 Mac OS X 10.3.7

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>