Skip to main content
GameDev.net gamedev.net
🔒 Locked

Alpha Blending

Started by Lord Chiko Jun 19, 2006 at 6:12 PM 1 replies 750+ views
Original Post
Lord Chiko
Lord Chiko
Hey i want to create a program that does alphablending RealTime i know there are other code samples but i need this specific to my request i have made a code that goes pixel by pixel in visual basic manipulates them then updates the image after testing the code and performing comparisons the only part slowing my code down is the logic now i've tried the same logic in c++ and the speed i get is perfect just the problem is i want to code this in Visual Basic i know i can make a C++ DLL and call from that but i don't know how to pass an Array of bytes that c++ can manipulate and send them back just some specs on the VB code i can draw a 804 by 564 24 bit image 213 Times a second when i set it to alpha it drops to it draws 804 by 564 24 bit image 2 times a second significant performance hit however this hit is nowhere to be found done under C++ so is there anyway i can pass an array to c++ that visual basic won't constantly check when c++ modifies it or like copy a vb array based on its pointer to another 1 (done in c++) manipulate it then copy back over the old pointer?
Rockoon1
Rockoon1
Use the same technique that you use in C++

Clearly you are currently using Pset()/Point() or GetPixel()/SetPixel() in VB but are not doing so in C++.

The lack of poiners in VB shouldn't be a real problem... you can make a VB safearray point anywhere in memory.
Lord Chiko
Lord Chiko
Quote:
Original post by Rockoon1
Use the same technique that you use in C++

Clearly you are currently using Pset()/Point() or GetPixel()/SetPixel() in VB but are not doing so in C++.

The lack of poiners in VB shouldn't be a real problem... you can make a VB safearray point anywhere in memory.


yes ty i created a thread about pointers and got the answers i was after

p.s

i was using dibit in vb

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.