|
DirectX Error: TXFORM2
#403473
06/20/12 20:51
06/20/12 20:51
|
Joined: Aug 2005
Posts: 238
Caermundh
OP
Member
|
OP
Member
Joined: Aug 2005
Posts: 238
|
I am getting the error message "DirectX Error: TXFORM2" at runtime when i try to lock a bitmap with bmap_lock.
Heres what im doing:
BMAP* letter_bmap;
function main() { letter_bmap = bmap_create("georgia_font2.jpg"); wait(1); bmap_to_format(letter_bmap,8888); bmap_lock(letter_bmap,0); }
Does anyone know what this error means?
Last edited by Caermundh; 06/20/12 20:52.
|
|
|
Re: DirectX Error: TXFORM2
[Re: Caermundh]
#403479
06/21/12 03:27
06/21/12 03:27
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
User
|
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
I don't know what that error means exactly, but check if bmap_to_format actually worked. If it returns 0, then the conversion failed. Also, as you can read in the manual under "file formats", the use of the jpg is discouraged: JPG images should not be used for textures in realtime games. They combine all disadvantages of the other formats, plus the additional disadvantage of slow loading, high video memory consumption, and bad texture quality. Their only advantage is small file size. Also: Also supported, but not recommended are BMP, PNG and JPG images - they are read through the DirectX library and thus depend on the DirectX version, and have other shortcomings. The selected image format does matter because all formats have their specific advantages and disadvantages: So maybe DirectX loads them in a way so that you can't use bmap lock and other manipulation functions. You might want to try the same code with another file format. Recommended image formats are TGA, DDS, PCX and WAD. Hope this helped.
|
|
|
Re: DirectX Error: TXFORM2
[Re: sivan]
#403546
06/21/12 20:09
06/21/12 20:09
|
Joined: Feb 2009
Posts: 3,207 Germany, Magdeburg
Rei_Ayanami
Expert
|
Expert
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
|
as it is described in the manual at bmap_lock page, it's not allowed to use bmap_lock before the first frame He put a wait(1) in the code above. and in your code there is no level loaded. put a level_load(NULL); in the beginning and a wait(1); it should work fine. That is really not needed as it should not have any effect on the 2D functions.
|
|
|
Re: DirectX Error: TXFORM2
[Re: Rei_Ayanami]
#403551
06/21/12 21:07
06/21/12 21:07
|
Joined: Aug 2005
Posts: 238
Caermundh
OP
Member
|
OP
Member
Joined: Aug 2005
Posts: 238
|
yeah, im unlocking it later, at the end of the subroutine - or rather, before i was using a subroutine, i was unlocking it at the end of main, but seeing as how it was crashing on the bmap_lock() command, unlocking it seemed like a moot point.
Last edited by Caermundh; 06/21/12 21:08.
|
|
|
|