• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

VS2010 - BlackBox (OpenGL + Audio + XP AERO like)

Started by Patrice Terrier, August 17, 2007, 10:47:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

The project uses exclusively the features found in VISUAL C# 2005 Express Edition.

The ZIP file content

- Project source code for DotNET 2.0+
- Skinned form in 9-image mode using variable opacity on NT platforms.
- Visual effects based on OpenGL.
- Playing MP3 audio using BASS.DLL.
- PNG graphic components specificaly designed for the project.
- One free MP3 audio file.

Apart of the MAIN_Form class, the project uses 4 specific classes:
1 - Audio.cs (BASS.dll interface).
2 - OpenGL.cs (OpenGL interface).
3 - Win32.cs (Flat API encapsulation).
4 - SkinEngine (properties and methods of the Skin Engine).

Note: The mp3 file and BASS.dll are located into the project folder named "\bin\debug".
BASS.dll from Ian Luck (www.un4seen.com) is a prerequisite for playing audio.

Very important:
The code must take over the WinProc, to handle the very important WM_NCHITTEST message,
to mimic the behavior of a standard window.

Drag & drop:
You can use it between Explorer and BlackBox to play any mp3 files !

SETUP parameters:
private void SETUP_parameters()
{
    // Setup default Skin colors
    SK.ColorLayerBackground = Color.FromArgb(255, 64, 64, 64);
    SK.ColorCaptionEnabled = Color.FromArgb(255, 220, 220, 220);
    SK.ColorCaptionDisabled = Color.FromArgb(255, 92, 92, 92);

    // Skin opacity in the range 0-255
    SK.Alpha = 204; // 80 % default transparency level

    // OpenGL
    InitOpenGL(OPENGL_Container.Handle);
    StartAnimation();
    // Try playing with these parameters
    Pulsating = true; // Rem this out to disable pulsating effect
    Velocity = true;  // Rem this out to disable velocity effect

    // BASS.dll
    BASS.Init(hFORM_Main);
    // Default audio file (Edit to use yours)
    BASS.FileToPlay = @"BlackBox.mp3";

    // Drag & drop
    // It accepts only mp3 files dragged from Windows Explorer
    Api.DragAcceptFiles(hFORM_Main, true);

}


Last, but not the least:
For those who may wonder why I am not using exclusively managed code.
Suffice to say that because I am working with different languages, it is easier for me (when writting demo) to use the only common denominator to all of them, the Flat Win32 API.

Screen shot:




Patrice Terrier
www.zapsolution.com
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

The first post of this thread has been updated, to fix the ZIP file corruption caused by the "Server Collapse".

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com