DLL to extend B3D released
Blitz3D Forums/Blitz3D Userlibs/DLL to extend B3D released
| ||
I have uploaded the completed dll to our server, it adds a number of new commands to blitz3d. I have tested the commands and all seem to work fine, let me know if you experience any probs. The zip contains the dll, decls as well as the freebasic code used to create the dll enjoy, Bill Download @ Blitz3d+.dll ;Camera BP_GetCamClsMode%( camera,index$ ) : "GetCamClsMode@8" ; index$ = "Color" Or "Zbuffer" returns 0 Or 1 BP_GetCamClsColorR%( camera ) : "GetCamClsColorR@4" ; returns red component of CameraClsColor BP_GetCamClsColorG%( camera ) : "GetCamClsColorG@4" ; returns green component of CameraClsColor BP_GetCamClsColorB%( camera ) : "GetCamClsColorB@4" ; returns blue component of CameraClsColor BP_GetCamProjMode%( camera ) : "GetCamProjMode@4" ; returns CameraProjMode 0-2 BP_GetCamRangeNear#( camera ) : "GetCamRangeNear@4" ; returns CameraRange "near" BP_GetCamRangeFar#( camera ) : "GetCamRangeFar@4" ; returns CameraRange "far" BP_GetCamZoom#( camera ) : "GetCamZoom@4" ; returns CameraZoom BP_GetCamViewPortX%( camera ) : "GetCamViewPortX@4" ; returns CameraViewport "x" BP_GetCamViewPortY%( camera ) : "GetCamViewPortY@4" ; returns CameraViewport "y" BP_GetCamViewPortW%( camera ) : "GetCamViewPortW@4" ; returns CameraViewport "width" BP_GetCamViewPortH%( camera ) : "GetCamViewPortH@4" ; returns CameraViewport "height" BP_GetCamFogMode%( camera ) : "GetCamFogMode@4" ; returns CameraFogMode 0 (none) Or 1 (linear) BP_GetCamFogNear#( camera ) : "GetCamFogNear@4" ; returns CameraFogRange "near" BP_GetCamFogFar#( camera ) : "GetCamFogFar@4" ; returns CameraFogRange "far" BP_GetCamFogColorR%( camera ) : "GetCamFogColorR@4" ; returns red component of CameraFogColor BP_GetCamFogColorG%( camera ) : "GetCamFogColorG@4" ; returns green component of CameraFogColor BP_GetCamFogColorB%( camera ) : "GetCamFogColorB@4" ; returns blue component of CameraFogColor BP_GetCamFOV#( camera ) : "GetCamFOV@4" ; returns CameraZoom as degrees FOV BP_SetCamFOV%( camera,FOV# ) : "SetCamFOV@8" ; sets CameraZoom as degrees FOV ;Light BP_SetLightType%( light,style ) : "SetLightType@8" ; changes LightType on the fly BP_SetLightDiffuse%( light,red,green,blue,alpha# ) : "SetLightDiffuse@20" ; sets diffuse rgba ( same as LightColor + alpha component ) BP_SetLightSpecular%( light,red,green,blue,alpha# ) : "SetLightSpecular@20" ; sets specular rgba ( not normally accessable in b3d ) BP_SetLightAmbient%( light,red,green,blue,alpha# ) : "SetLightAmbient@20" ; sets specular rgba ( not normally accessable in b3d ) BP_SetLightMaxRange%( light,range# ) : "SetLightMaxRange@8" ; sets absolute LightRange ( not normally accessable in b3d ) BP_SetLightAtten0( light,value# ) : "SetLightAtten0@8" ; attenuation value 0 effects light fall off ( not normally accessable in b3d ) BP_SetLightAtten1( light,value# ) : "SetLightAtten1@8" ; attenuation value 1 effects light fall off ( Not normally accessable in b3d ) BP_SetLightFallOff( light,value# ) : "SetLightFallOff@8" ; effects lightcone fall off for spot lights ( not normally accessable in b3d ) BP_GetLightType%( light ) : "GetLightType@4" ; returns LightType BP_GetLightMaxRange#( light ) : "GetLightMaxRange@4" ; returns absolute LightRange ( not normally accessable in b3d ) BP_GetLightRange#( light ) : "GetLightRange@4" ; returns LightRange BP_GetLightInner#( light ) : "GetLightInner@4" ; returns LightConeAngles "inner angle" BP_GetLightOuter#( light ) : "GetLightOuter@4" ; returns LightConeAngles "outer angle" BP_GetLightDiffuseR%( light ) : "GetLightDiffuseR@4" ; returns red component of lights diffuse Color BP_GetLightDiffuseG%( light ) : "GetLightDiffuseG@4" ; returns green component of lights diffuse color BP_GetLightDiffuseB%( light ) : "GetLightDiffuseB@4" ; returns blue component of lights diffuse color BP_GetLightDiffuseA#( light ) : "GetLightDiffuseA@4" ; returns alpha component of lights diffuse color BP_GetLightSpecularR%( light ) : "GetLightSpecularR@4" ; returns red component of lights specular color BP_GetLightSpecularG%( light ) : "GetLightSpecularG@4" ; returns green component of lights specular color BP_GetLightSpecularB%( light ) : "GetLightSpecularB@4" ; returns blue component of lights specular color BP_GetLightSpecularA#( light ) : "GetLightSpecularA@4" ; returns alpha component of lights specular Color BP_GetLightAmbientR%( light ) : "GetLightAmbientR@4" ; returns red component of lights ambient Color BP_GetLightAmbientG%( light ) : "GetLightAmbientG@4" ; returns green component of lights ambient Color BP_GetLightAmbientB%( light ) : "GetLightAmbientB@4" ; returns blue component of lights ambient Color BP_GetLightAmbientA#( light ) : "GetLightAmbientA@4" ; returns alpha component of lights ambient Color BP_GetLightAtten0#( light ) : "GetLightAtten0@4" ; returns light attenuation value 0 BP_GetLightAtten1#( light ) : "GetLightAtten1@4" ; returns light attenuation value 1 BP_GetLightFallOff#( light ) : "GetLightFallOff@4" ; returns lightcone falloff for spot lights ;Entity BP_GetEntityAlpha#( entity ) : "GetEntityAlpha@4" ; returns EntityAlpha BP_GetEntityScaleX#( entity ) : "GetEntityScaleX@4" ; returns EntityScale "x" BP_GetEntityScaleY#( entity ) : "GetEntityScaleY@4" ; returns EntityScale "y" BP_GetEntityScaleZ#( entity ) : "GetEntityScaleZ@4" ; returns EntityScale "z" BP_GetEntityAutoFade%( entity ) : "GetEntityAutoFade@4" ; returns true if EntityAutoFade has been set BP_ClrEntityAutoFade%( entity ) : "ClrEntityAutoFade@4" ; Cls EntityAutoFade if set BP_GetEntityAutoNear#( entity ) : "GetEntityAutoNear@4" ; returns EntityAutoFade "near" BP_GetEntityAutoFar#( entity ) : "GetEntityAutoFar@4" ; returns EntityAutoFade "far" BP_GetEntityOrder%( entity ) : "GetEntityOrder@4" ; returns EntityOrder BP_GetNextEntity%( entity ) : "GetNextEntity@4" ; returns entity following this one BP_GetLastEntity%( entity ) : "GetLastEntity@4" ; returns entity before this one BP_GetEntityHidden%( entity ) : "GetEntityHidden@4" ; returns true if entity is hidden BP_GetEntityRadiusX#( entity ) : "GetEntityRadiusX@4" ; returns EntityRadius "x" BP_GetEntityRadiusY#( entity ) : "GetEntityRadiusY@4" ; returns EntityRadius "y" BP_GetEntityBoxX#( entity ) : "GetEntityBoxX@4" ; returns EntityBox "x" BP_GetEntityBoxY#( entity ) : "GetEntityBoxY@4" ; returns EntityBox "y" BP_GetEntityBoxZ#( entity ) : "GetEntityBoxZ@4" ; returns EntityBox "z" BP_GetEntityBoxW#( entity ) : "GetEntityBoxW@4" ; returns EntityBox "width" BP_GetEntityBoxH#( entity ) : "GetEntityBoxH@4" ; returns EntityBox "height" BP_GetEntityBoxD#( entity ) : "GetEntityBoxD@4" ; returns EntityBox "depth" BP_GetEntityPickmode%( entity ) : "GetEntityPickmode@4" ; returns EntityPickMode 0-3 BP_GetEntityObscurer%( entity ) : "GetEntityObscurer@4" ; returns true if entity obscures others, set by EntityPickMode BP_GetEntityColorR%( entity ) : "GetEntityColorR@4" ; returns red component of EntityColor BP_GetEntityColorG%( entity ) : "GetEntityColorG@4" ; returns green component of EntityColor BP_GetEntityColorB%( entity ) : "GetEntityColorB@4" ; returns blue component of EntityColor BP_GetEntityShine#( entity ) : "GetEntityShine@4" ; returns EntityShininess BP_GetEntityBlend%( entity ) : "GetEntityBlend@4" ; returns EntityBlend BP_GetEntityFX%( entity ) : "GetEntityFX@4" ; returns EntityFX ;Texture BP_GetTextureBlend%( texture ) : "GetTextureBlend@4" ; returns TextureBlend BP_GetTextureCoords%( texture ) : "GetTextureCoords@4" ; returns TextureCoords BP_GetTextureScaleU#( texture ) : "GetTextureScaleU@4" ; returns ScaleTexture "u" BP_GetTextureScaleV#( texture ) : "GetTextureScaleV@4" ; returns ScaleTexture "v" BP_GetTexturePositionU#( texture ) : "GetTexturePositionU@4" ; returns PositionTexture "u" BP_GetTexturePositionV#( texture ) : "GetTexturePositionV@4" ; returns PositionTexture "v" BP_GetTextureRotation#( texture ) : "GetTextureRotation@4" ; returns texture rotation BP_GetTextureFlags%( texbuffer ) : "GetTextureFlags@4" ; returns texture flags BP_ScrollTexture#( texture,u#,v# ) : "ScrollTexture@12" ; scrolls texture by relative amount ;Brush BP_GetBrushBlend%( brush ) : "GetBrushBlend@4" ; returns BrushBlend 1-3 BP_GetBrushColorRGB%( brush ) : "GetBrushColorRGB@4" ; returns BrushColor as an integer BP_GetBrushColorR%( brush ) : "GetBrushColorR@4" ; returns red component of BrushColor BP_GetBrushColorG%( brush ) : "GetBrushColorG@4" ; returns green component of BrushColor BP_GetBrushColorB%( brush ) : "GetBrushColorB@4" ; returns blue component of BrushColor BP_GetBrushFX%( brush ) : "GetBrushFX@4" ; returns BrushFX BP_GetBrushShininess#( brush ) : "GetBrushShininess@4" ; returns BrushShininess BP_GetBrushAlpha#( brush ) : "GetBrushAlpha@4" ; returns BrushAlpha BP_GetBrushNumTextures%( brush ) : "GetBrushNumTextures@4" ; returns number of textures used by this brush BP_SetBrushTexture%( brush,index,texture ) : "SetBrushTexture@12" ; Changes Brush texture on the fly, texture=0 to clear texture ; If already applied to entity use RefreshEntityBrush() to update entity BP_RefreshEntityBrush%( entity ) : "RefreshEntityBrush@4" ; updates entity brush structure ;Sprite BP_GetSpriteHandleX#( sprite ) : "GetSpriteHandleX@4" ; returns HandleSprite "x" BP_GetSpriteHandleY#( sprite ) : "GetSpriteHandleY@4" ; returns HandleSprite "y" BP_GetSpriteAngle#( sprite ) : "GetSpriteAngle@4" ; returns angle set by RotateSprite BP_GetSpriteScaleX#( sprite ) : "GetSpriteScaleX@4" ; returns ScaleSprite "x" BP_GetSpriteScaleY#( sprite ) : "GetSpriteScaleY@4" ; returns ScaleSprite "y" BP_GetSpriteViewMode%( sprite ) : "GetSpriteViewMode@4" ; returns SpriteViewMode ;Color Conversion BP_GetIntRed%( IntColor ) : "GetIntRed@4" ; returns red component of an integer BP_GetIntGreen%( IntColor ) : "GetIntGreen@4" ; returns green component of an integer BP_GetIntBlue%( IntColor ) : "GetIntBlue@4" ; returns blue component of an integer BP_GetIntAlpha%( IntColor ) : "GetIntAlpha@4" ; returns alpha component of an integer BP_GetRGBInt%( r,g,b ) : "GetRGBInt@12" ; converts r,g,b to integer BP_GetRGBAInt%( r,g,b,a ) : "GetRGBAInt@16" ; converts r,g,b,a To integer ;Math BP_CurveValue#( newvalue#,oldvalue#,increments# ) : "CurveValue@12" BP_WrapValue#( value#,lo#,hi# ) : "WrapValue@12" BP_ClampValue#( value#,lo#,hi# ) : "ClampValue@12" BP_Min#( value1#,value2# ) : "Min@8" BP_Max#( value1#,value2# ) : "Max@8" BP_Distance2d#( x1#,y1#,x2#,y2# ) : "Distance2D@16" BP_Distance3d#( x1#,y1#,z1#,x2#,y2#,z2# ) : "Distance3D@24" BP_PointInRect#( x1#,y1#,rx#,ry#,rw#,rh# ) : "PointInRect@24" ;Memory BP_PeekByte%( address ) : "PeekByte@4" BP_PeekShort%( address ) : "PeekShort@4" BP_PeekInt%( address ) : "PeekInt@4" BP_PeekFloat#( address ) : "PeekFloat@4" BP_PokeByte( address,value% ) : "PokeByte@8" BP_PokeShort( address,value% ) : "PokeShort@8" BP_PokeInt( address,value% ) : "PokeInt@8" BP_PokeFloat( address,value# ) : "PokeFloat@8" |
| ||
Oooh. |
| ||
Thanks and thanks! I downloaded it twice so thanks again. |
| ||
Ripper. Downloading now - thanks very much for this! |
| ||
Very useful DLL. Thanks! |
| ||
i wonder if this would work with B3dSDK |
| ||
So.... scrolling a texture without needing variables would look like this: PositionTexture texture, BP_GetTexturePositionU(texture) + 0.05, BP_GetTexturePositionU(texture) + 0.05 .....or......... BP_ScrollTexture(texture, 0.05, 0.05) I would like to know what is the advantage of using these as opposed to using regular blitz peek and poke: BP_PeekByte%( address ) : "PeekByte@4" BP_PeekShort%( address ) : "PeekShort@4" BP_PeekInt%( address ) : "PeekInt@4" BP_PeekFloat#( address ) : "PeekFloat@4" BP_PokeByte( address,value% ) : "PokeByte@8" BP_PokeShort( address,value% ) : "PokeShort@8" BP_PokeInt( address,value% ) : "PokeInt@8" BP_PokeFloat( address,value# ) : "PokeFloat@8" |
| ||
Thanks a lot! As far as I see GetTextureFlags takes the texturebuffer as a parameter - any Idea on how to handle DDS textures (they return zero as buffer ID!)? |
| ||
Thanks for this! Newsed on the german board. :) |
| ||
_33 "I would like to know what is the advantage of using these as opposed to using regular blitz peek and poke:" Blitz Peek/Poke only operate with Blitz's Bank. BB_Poke an BB_Peek, with the entire system memory. Use carefully. In French : Il me semble que tu comprends le francais _33 ;-) . La différence est la suivante. Les Peeks et Pokes de BLitz ne fonctionnent qu'avec les Banks. En revanche, avec BB_Peek* et BB_Poke*, tu peux accéder a toutes les adresses memoires du systeme. Accès le plus souvent protégé par le système. JP |
| ||
ze french blitz user ZJP ouééééé!!! OkieZ merci mais t'as rien ajouté dans ton explication française, j'aurais pensé à un bonus? Thanks for your french traduction ;) Well the first interesting thing I would use this on would be on image memory. But I guess it's not as easy as that. You need to get the pointer of the image, and the image has to reside in the system RAM, not the videocard! So, this is the first place I would try to use this. I'll try to do it this weekend. |
| ||
Where is your report soldier? |
| ||
good stuff, thanks for this. |
| ||
Oh I forgot to say, that when you copy from image buffer to texture buffer, you loose the alpha channel. |
| ||
Leon - not sure but i imagine it will unless BRL changed the structures themselves jfk EO-11110 - I haven't played around with DDS textures but if I get a chance I'll play around a little & see what I come up with. If anybody knows of any offsets I have missed , would appreciate it if you could pass em on. Thanks for the input guys, has anyone ran into any bugs so far ? |
| ||
hi Billp, I written a question on the programming forum about the .label clause in Blitz. I want to know what you think about it. http://www.blitzbasic.com/Community/posts.php?topic=77709 |
| ||
Niiiiice :o) Thanks! |
| ||
Uhm... very nice, but where is "EntityExists()" ? |
| ||
And NextEntity() - this lets you access all the entities in the world. I remember Leadwerks did something similar. It's quite useful. |
| ||
@ Beaker I got em' BP_GetNextEntity%( entity ) : "GetNextEntity@4" ; returns entity following this one BP_GetLastEntity%( entity ) : "GetLastEntity@4" ; returns entity before this one @ Sake906 if you create a world pivot or some such you can use BP_GetNextEntity%( entity ) to loop thru them all & check for EntityExists() I may update the dll soon & will add this command when I do I had hoped to access animation info as well but cannot find out how to do so, even Mark couldn't tell me how to find it lol. I also would like to Add EntityOriginX,Y,Z etc. but the pointers used by others in the past don't seem to be correct, they always contain 0 |
| ||
can help tutorial create dll for blitz3d step by step |
| ||
The Freebasic code used to create the dll is available with the download, is that of any help ? |
| ||
I have a serious problem here... BP_GetNextEntity%( entity ) and its counterpart rarely ever return the "next" entity when I use a world pivot (yes, created at the begining when all life as we know it was created) It keeps returning zero and I have been two days trying to figure this thing out... I think other functions on the library aren't working quite well either... am I doing something wrong? missing something? |
| ||
Actually you are correct I had the Next/Last offsets screwed up, I re-ftped the zip & it should work ok now, what else have you had problems with ? |
| ||
What I was thinking BP_ClampValue(Value#,-2,2) would do, would be a shorter version of doing thisIf Value < -2 Then Value = -2 If Value > 2 Then Value = 2 But it didn't do that. It didn't do anything. Here's what I tried. Heh, do I have the wrong idea of what this function is supposed to do? |
| ||
BP_ClampValue returns a value which you have to assign to Clamp Clamp = BP_ClampValue(Clamp,-2,2) |
| ||
does it work with BlitzPlus the program? Blitzplus managed to load after extracting and copying the .dll and .decls file. |
| ||
does it work with BlitzPlus the program? BlitzPlus doesn't have cameras, lights, entities, textures, brushes or sprites. What possible use would those commands be to you in BlitzPlus? The color conversion, memory and math stuff should work fine, although those few functions are almost certainly available elsewhere. |
| ||
I would love to see the source of this... so it could be implemented using the windows api, without the need for a dll. At least a list of offsets would do it. Nevermind, found it: http://web.archive.org/web/20041106111618/http://www.blitzbasic.com/Community/posts.php?topic=27669 |
| ||
The zip contains the dll, decls as well as the freebasic code used to create the dll |
| ||
The link seems dead now, is anyone else able to upload this? |
| ||
We let our server go but I have uploaded it to http://www.mediafire.com/?mj2jkayogo2 Bill |
| ||
Thank you very much, Bill! I guess I should check these things more regularly than 11 months later :D |
| ||
I notice that the colour conversion functions:BP_GetIntRed%( IntColor ) : "GetIntRed@4" ; returns red component of an integer BP_GetIntGreen%( IntColor ) : "GetIntGreen@4" ; returns green component of an integer BP_GetIntBlue%( IntColor ) : "GetIntBlue@4" ; returns blue component of an integer BP_GetIntAlpha%( IntColor ) : "GetIntAlpha@4" ; returns alpha component of an integer BP_GetRGBInt%( r,g,b ) : "GetRGBInt@12" ; converts r,g,b to integer BP_GetRGBAInt%( r,g,b,a ) : "GetRGBAInt@16" ; converts r,g,b,a To integer Seem to operate by returning the overall Integer as a negative, with 255,255,255 being equivalent to -1 Whilst this isn't so much a problem itself, it does have a side effect where the BLUE component is in fact the first and the RED component is the last one returned. It's not too hard to alter in the Decls, switching the Red and the Blue function names :) |
| ||
Is this BLITZ 3D Library for Freebasic? |
| ||
Could anyone answer the question above please. |
| ||
No, This is a lib for Blitz3D, make with FreeBasic ;-) JP |
| ||
I just got around to having a go on this. BP_SetLightMaxRange%( light,range# ) works like a dream come true in Blitz3D-land - in terms of actually having a maximum range a light can reach without continuing to bleed all over everything Blitz3D's internal LightRange command was always a bit squiffy. The good thing about the internal version is that it was very, very subtle - albeit very inaccurate. The new one is too abrubt (it doesn't shade), yet it does exactly what it is meant to. Luckily it works alongside LightRange so that you can lessen the abruptness. |
| ||
Is this faster then same function writen in pure blitzbasic? |
| ||
I've found that freebasic in general is slightly faster than blitzbasic even if called via dll. I use it with the MT random number generator that is more consistent than the native blitz commands. |
| ||
The mdeiafire link doesn't seem to be working, does anybody have the original upload? |
| ||
Thanks |
| ||
"...The mdeiafire link doesn't seem to be working, does anybody have the original upload?..." Here. I would keep the link for a few days :-) *Removed* JP |
| ||
Got it, Thank you :) |
| ||
You're welcome... JP |
| ||
I don't understand the advanced light parameters (lightcone)? How can I set a flashlight like light? Thanks the help |
| ||
You can make a flashlight with the standard Blitz3D spotlight. |
| ||
Yes, thank you |
| ||
Some descriptions listed in the Decls comments are a little off, for example BP_SetLightAmbient states "Sets the Specular Light" Of course,, it's a little obvious but just pointing it out :) |
| ||
BP_GetEntityHidden%( entity ) : "GetEntityHidden@4" ; returns true if entity is hidden This also appears to be incorrect. BP_GetEntityHidden() returns FALSE for Hidden, and TRUE for 'shown' Entities. In my own decls file, I've renaamed the function "BP_GetEntityShown()" :) |
| ||
BP_GetEntityHidden(entity) returns "-1" if entity is 'shawn" and "0" if not... is that the normal way ? or there is something wrong ? ( I use blitz3d 1.98 , cause, newer versions have issues with fastext ) This dll(+decls) works by dealing with memory, so maybe offsets are differents in internal class of the blitz3d engine ... ?! So my question : Wich version of blitz3d is this dll intended to run with ? |
| ||
Freebasic returns NOT TRUE, which means -1 opposed to FALSE 0 in Blitz. Maybe this clarifies some issues. |
| ||
That would explain it, -1 is a True result, as is anything OTHER than 0 in Blitz3D. That may also explain the colour issues... |
| ||
Working well with Blitz3D 1.103? JP |
| ||
I've never needed ALL the functions, so any results of mine would be incomplete, but so far so good, I've not come across anything broken over the last few B3D updates. And to be honest, I don't expect any to either, I think a lot of these functions access DX7 in ways in which B3D itself doesn't include the functions for. So only changig DX7 might affect this Lib (I think, anyway!) |
| ||
Having had it pointed out the link here was dead, I've uploaded the version I have HERE for anyone who's looking for it. Hope it helps (and apologies for the rampant necropost). |
| ||
AHHHHH /makes a mirror which you can also get here http://www.vigilsoft.net/Blitz3dplus.zip |
| ||
seo for future searchers : this external lib allows you to get the brush color (red, green, blue) and to get the brush alphaBP_GetBrushColorR%( brush ) : "GetBrushColorR@4" ; returns red component of BrushColor BP_GetBrushColorG%( brush ) : "GetBrushColorG@4" ; returns green component of BrushColor BP_GetBrushColorB%( brush ) : "GetBrushColorB@4" ; returns blue component of BrushColor BP_GetBrushAlpha#( brush ) : "GetBrushAlpha@4" ; returns BrushAlpha |
| ||
Where Download? |
| ||
here : http://expirebox.com/download/7bf0cb6d8f5b58a0c587db287f3af3a0.html |
| ||
@RemiD Thanks You. :) |
| ||
@RemiD Thanks for the "DLL to extend B3D" I'm glad I got it before the expirebox expired. ![]() |
| ||
Is there any documentation for this anywhere? |
| ||
Yes, in post#1, just read what each function allows you to set/get... |
| ||
Is there another link for the dll, it's expired |
| ||
here : https://file.town/download/v24lt7j1er3i7se80yryqvmed |
| ||
Thanks\ Glad someone have that one. The vivid2d / 3d links are gone as well |