Any chances you'd be able to create an OpenGL context on a PB window? There's code for this on the forum for all platforms, but obviously not for Cocoa
[PB Cocoa] Cocoa companion library
Re: [PB Cocoa] Cocoa companion library
You're doing a nice work here!! 
Any chances you'd be able to create an OpenGL context on a PB window? There's code for this on the forum for all platforms, but obviously not for Cocoa
Any chances you'd be able to create an OpenGL context on a PB window? There's code for this on the forum for all platforms, but obviously not for Cocoa
Re: [PB Cocoa] Cocoa companion library
Yes, there's NSOpenGLView.Polo wrote:Any chances you'd be able to create an OpenGL context on a PB window? There's code for this on the forum for all platforms, but obviously not for Cocoa
Basically it's a bit like a gadget. You can define a rectangle and add it to a window.
The problem is that I know nothing about OpenGL. Can you point me to some short code that would be useful to test if it works ?
Re: [PB Cocoa] Cocoa companion library
I haven't got any code unfortunately, I don't know Cocoa too much!
Actually it'd be great to have a cross platform OpenGLGadget()
Actually it'd be great to have a cross platform OpenGLGadget()
Re: [PB Cocoa] Cocoa companion library
@Polo
Not sure what you are trying to do exactly but there is already OpenGL in PB. If you are looking for some king of scrolling text effect or something, it can be done.
Not sure what you are trying to do exactly but there is already OpenGL in PB. If you are looking for some king of scrolling text effect or something, it can be done.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
Re: [PB Cocoa] Cocoa companion library
I know, though there is not OpenGL Gadget, ie just a part of a window ready to use with the opengl APIJ. Baker wrote:@Polo
Not sure what you are trying to do exactly but there is already OpenGL in PB. If you are looking for some king of scrolling text effect or something, it can be done.
Re: [PB Cocoa] Cocoa companion library
You can use a WindowedScreen(), and use glcommand in it (indeed you need to use opengl subsystem on windows). Should work on all OS
@wilbert: i looked at your source, and you don't need to create the autorelease pool for each command, as PB already have one (which is flushed in Wait/WindowEvent())
@wilbert: i looked at your source, and you don't need to create the autorelease pool for each command, as PB already have one (which is flushed in Wait/WindowEvent())
Re: [PB Cocoa] Cocoa companion library
Thanks for the tip, will try that!Fred wrote:You can use a WindowedScreen(), and use glcommand in it (indeed you need to use opengl subsystem on windows). Should work on all OS
@wilbert: i looked at your source, and you don't need to create the autorelease pool for each command, as PB already have one (which is flushed in Wait/WindowEvent())
Re: [PB Cocoa] Cocoa companion library
Thanks for the info Fred.Fred wrote:@wilbert: i looked at your source, and you don't need to create the autorelease pool for each command, as PB already have one (which is flushed in Wait/WindowEvent())
Is the pool already allocated in the beginning ?
I was wondering what happens to objects created before the repeat loop that handles events.
Some commands to extend the capability of the gadgets would probably be called after the creation of the gadget but before the first event loop.
Re: [PB Cocoa] Cocoa companion library
The pool is created at the very beginning of the program, in PureBasic init routine, before any program command.
Re: [PB Cocoa] Cocoa companion library
That's greatFred wrote:The pool is created at the very beginning of the program, in PureBasic init routine, before any program command.
Added a few more commands
The sound commands support all sound formats that are supported by either Core Audio or QuickTime.
Sound_Catch (*MemoryAddress, Size) - Catch sound from memory.
Sound_IsPlaying (SoundObject) - Returns #True is the sound object is playing.
Sound_Load (FileName.s) - Load sound.
Sound_Play (SoundObject [, Loop]) - Starts playing the sound object.
Sound_Release (SoundObject) - Releases the sound object.
Sound_SetVolume (SoundObject, Volume.d) - Sets the volume of the sound object.
Sound_Stop (SoundObject) - Stops playing the sound object.
UUID_Create() - Returns a universally unique identifier.
Window_SetAlpha (WindowID, Alpha.d)- Sets the alpha value of the window.
-
jesperbrannmark
- Enthusiast

- Posts: 536
- Joined: Mon Feb 16, 2009 10:42 am
- Location: sweden
- Contact:
Re: [PB Cocoa] Cocoa companion library
When you are talking about "opengl" text in a normal window.
I dont really understand that. I have seen this in multiple Mac OS X applications that look great.

Is this what you mean? If so... yes please
So like a warning message that fades in and fades out - semi transparent with white text.. very nice.
I dont really understand that. I have seen this in multiple Mac OS X applications that look great.

Is this what you mean? If so... yes please
So like a warning message that fades in and fades out - semi transparent with white text.. very nice.
Re: [PB Cocoa] Cocoa companion library
@Jesper, I don't know what you mean.
If all you want is some flashing message on top of a window, OpenGL is a lot of overkill.
If all you want is some flashing message on top of a window, OpenGL is a lot of overkill.
Re: [PB Cocoa] Cocoa companion library
Hey Wilbert, can you explain more on the UUID? Thanks!
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
Re: [PB Cocoa] Cocoa companion library
It's just a small command that internally creates a CFUUID and outputs it as a PureBasic string.J. Baker wrote:Hey Wilbert, can you explain more on the UUID? Thanks!
It looked useful enough to me to put it in.
According to the Apple docs
Does that help ?Apple docs wrote:UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs (Interface Identifiers), are 128-bit values guaranteed to be unique. A UUID is made unique over both space and time by combining a value unique to the computer on which it was generated—usually the Ethernet hardware address—and a value representing the number of 100-nanosecond intervals since October 15, 1582 at 00:00:00.
The standard format for UUIDs represented in ASCII is a string punctuated by hyphens, for example 68753A44-4D6F-1226-9C60-0050E4C00067.
Re: [PB Cocoa] Cocoa companion library
I think that does. So basically, this unique id can then be attach to anything you need a unique id for?
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Even the vine knows it surroundings but the man with eyes does not.


