[ogre] catchmesh(), catchtexture(), catchmaterial() or ...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

[ogre] catchmesh(), catchtexture(), catchmaterial() or ...

Post by djes »

As I'm doing encryption for all other PB objects, I use a lot "catch" functions. Badly, there's no catchmesh(), catchtexture(), catchmaterial().
If it can't be done, maybe you can add a password protected zip reading, eg

Code: Select all

Add3DArchive("MyData.zip", #PB_3DArchive_Zip,"my_password")
Thanx! :)
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: [ogre] catchmesh(), catchtexture(), catchmaterial() or .

Post by J. Baker »

Catching the mesh, skeleton, and so forth would be nice. Maybe in 5.40, Fred? :D
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.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: [ogre] catchmesh(), catchtexture(), catchmaterial() or .

Post by DK_PETER »

(@Djes - Just saw, that it was a very old post getting bumped, so this is mostly to J. Baker).

Personally, I don't see the reason for embedding meshes. Your exe is gonna get massive real quick
and I guarantee you, that the majority is really not interested in your meshes, material scripts
or textures. There are LOTS of free stuff out there.

Anyway, if you feel it's REALLY important to "protect" your work...
Material scripts are simply text and can easily be imbedded.
Meshes can be embedded as binaries..I wouldn't do it myself, though. :-)
Textures are images and can be embedded and fetched with catchimage()

ex:

Code: Select all

InitEngine3D()
InitSprite()

UseJPEGImageDecoder()

OpenWindow(0, 0, 0, 800, 600, "BlitzTest")
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600)

Procedure.i CatchTexture(Index.i)
  Protected tx.i, im.i
  Select Index
    Case 0
      im = CatchImage(#PB_Any, ?TheImage)
    Case 1
      ;
  EndSelect
  tx = CreateTexture(#PB_Any, ImageWidth(im), ImageHeight(im))
  StartDrawing(TextureOutput(tx))
  DrawImage(ImageID(im),0,0)
  StopDrawing()
  ProcedureReturn tx
EndProcedure

Debug CatchTexture(0)
End

DataSection
  TheImage:
  IncludeBinary "G:\atlantis.jpg"
EndDataSection
But..You never know...The team might implement your requests. :-)
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: [ogre] catchmesh(), catchtexture(), catchmaterial() or .

Post by djes »

Look at the date of my post ;)
Anyway, for some projects, it would be nice to be able to protect the 3D work, to avoid things like cheat, robbery, or whatever the humain brain is capable of !
And for the "catch" things, maybe for portable apps, easy to give away.
User avatar
Mijikai
Addict
Addict
Posts: 1517
Joined: Sun Sep 11, 2016 2:17 pm

Re: [ogre] catchmesh(), catchtexture(), catchmaterial() or ...

Post by Mijikai »

+1
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 772
Joined: Fri Dec 04, 2015 9:26 pm

Re: [ogre] catchmesh(), catchtexture(), catchmaterial() or ...

Post by skinkairewalker »

+1
miso
Enthusiast
Enthusiast
Posts: 407
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: [ogre] catchmesh(), catchtexture(), catchmaterial() or ...

Post by miso »

catchtexture() +1
(for me it's not for protection)
(Also a bit more texture control would be nice. Ability to manually control mipmap levels, not always autogenerated. Mipmap distances or sometimes to disallow it. Ability to directly load a texture outside the scope of the parse3dscripts() part. 2d drawing is a bit slow on textureoutput().)
Post Reply