Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / simple code, no idea whats wrong?

Author
Message
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 20th Dec 2003 20:27
hey i just got DBP and i made a very simple program, but it doesnt display anything iv found the problem to orriginate from the line -> Create Bitmap ...
anyway here is the code

please tell me whats wrong
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 20th Dec 2003 20:44
where's "sync on : sync rate **" ?

schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 20th Dec 2003 20:53
oops, its in the line above... forgot to copy it in

nah its strange no matter what i try it wont work, seems like pretty generic code
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 20th Dec 2003 22:39
You need to use "set current bitmap 0". Bitmap 0 is the screen bitmap, if you want anything to show up bitmap 0 needs to be the current bitmap.



The code still doesn't do what you want it to. texture object requires an image number not a bitmap number. If you want to use a bitmap as a texture you need to use GET IMAGE and use the image you got.

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 20th Dec 2003 23:03
oh, thanks so much, worked like a charm ;o)
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 20th Dec 2003 23:48
btw, it shows the cube but not the texture... cant i texture objects with bitmaps?
HZence
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 21st Dec 2003 00:00
you certainly can, lemme take a look and see what you did.


Team EOD :: Programmer/Storyboard Assistant
HZence
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 21st Dec 2003 00:05
seems to be the way you draw your bitmap manually. if you wanna know whether it's your program or not, do a scribbly bmp in paint and use that as a texture.

if it works, it's your code.
if it doesn't, i don't know what the problem is.

hope i helped.


Team EOD :: Programmer/Storyboard Assistant
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Dec 2003 13:02
You can't texture object with bitmaps. You can only texture with images.

Once you have updated your bitmap, you will need to grab the bitmap into an image and re-texture using that.



For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 21st Dec 2003 13:42
I'm a bit perplexed as to how the code snippet from shoenhs manages to work. DB Pro does not allow an object number of 0. If you try to create one you get an error. He must put a 1 in the relevant global variable at some point I suppose.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 21st Dec 2003 20:48
It's this function here I think. It gets called before the make object command so the object num is 1. It's not too easy to follow what the code is doing.



dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
schoenhs
20
Years of Service
User Offline
Joined: 29th Nov 2003
Location:
Posted: 21st Dec 2003 22:51
thanks for all the help... getting my head round some of this stuff is kinda hard, specially comming from C++ which has no Bitmaps etc..

thanks alot!!!

Login to post a reply

Server time is: 2024-11-25 20:46:10
Your offset time is: 2024-11-25 20:46:10