![]() |
|
how to display file_select_ex on a BITMAP |
raja peter
Member #7,835
October 2006
|
hi, Sorry for repeating this question. I want to display the file choosing element using file_select_ex on a bitmap that is refreshed indefinitely until a user selection. When i using it, it comes in a new blank window. Pls help. luv, raja |
CGamesPlay
Member #2,559
July 2002
![]() |
Show your current code, please. -- Ryan Patterson - <http://cgamesplay.com/> |
raja peter
Member #7,835
October 2006
|
sorry for the delay. I had to go. char fname[480]= "C:/Dir"; luv, raja |
LennyLen
Member #5,313
December 2004
![]() |
Try swapping the order of these two lines: draw_sprite(screen, buffer, 0, 0); draw_sprite(buffer, opening,0,0); At the moment, you're blitting the buffer to the screen before you blit your sprite to the buffer. edit: Oh, and for compatibilty reasons, you shouldn't used fixed pathnames like "c:/dir".
|
Matthew Dalrymple
Member #7,922
October 2006
![]() |
Can you please expand on what's happening in your program. Quote: When i using it, it comes in a new blank window. Pls help.
Do you mean your screen is just blank, or the File select menu is blank? =-----===-----===-----= |
raja peter
Member #7,835
October 2006
|
a blank screen (black background) with only file select box appears also it does not enable the particular element to choose drives(c: ,d:, etc). I think the drawing on the buffer is the bone of contention. I draw a image on the whole screen and then put the file selection box on it (that image is refreshed infinitely). Here "opening" is that image. it is of full screen size(800,600). I'm probably confused with the images. I usually draw a full screen image on the screen as u can see in code. Then draw other images on the buffer like draw_sprite(buffer, classic, 180, 230); I display the file select box after the above statement. luv, raja |
Matthew Dalrymple
Member #7,922
October 2006
![]() |
Try what LennyLen suggested and see what happens. About the path names, changing char fname[480]= "C:/Dir"; to char fname[480]= ""; will give you your current directory. From there you can use relative pathnames to get to your resource folder. This way you can pack up and move your project without having to fix fname. EDIT: Ohh tag before your tag :-P =-----===-----===-----= |
LennyLen
Member #5,313
December 2004
![]() |
Quote: I think the drawing on the buffer is the bone of contention. I draw a image on the whole screen and then put the file selection box on it (that image is refreshed infinitely). Here "opening" is that image. it is of full screen size(800,600). Well, as both Matthew and I have already pointed out, this actually isn't what you are doing. Or rather you are doing it incorrectly. edit: It seems Matthew and I are playing tag.
|
raja peter
Member #7,835
October 2006
|
ok len, I'll try what u've said. I've got another doubt. How to display variable sized windows. luv, raja |
Kitty Cat
Member #2,815
October 2002
![]() |
file_select and file_select_ex are blocking. You can't put them on top of animated backgrounds since the function won't return until a selection is made. -- |
LennyLen
Member #5,313
December 2004
![]() |
Quote: Also suggesting you use backslashes instead of your forward slash method. As I believe forward slashes are a Windows only directory method. Better still, use fix_filename_slashes(), to convert filenames to the correct format on all platforms supported by Allegro. edit: Oh, and it's DOS/Windows that use backslashes. Quote: How to display variable sized windows. This isn't possible using Allegro alone, and you won't be able to find a cross-platform method of doing it (to my knowledge).
|
raja peter
Member #7,835
October 2006
|
len, what is openGL? Is it more sophisticated than allegro in doing things. luv, raja |
Matthew Dalrymple
Member #7,922
October 2006
![]() |
Is this the jist of what you're trying to do?
=-----===-----===-----= |
LennyLen
Member #5,313
December 2004
![]() |
Quote: what is openGL? OpenGL is a cross-platform graphics API. It's mainly used for 3D graphics, but can be used for 2D as well. Quote: Is it more sophisticated than allegro in doing things. I've never used it myself, but I really doubt it has functions like file_select_ex(). OpenLayer, which is an extension to Allegro that exposes OGL possibly does though.
|
23yrold3yrold
Member #1,134
March 2001
![]() |
OpenGL is graphics only, and pretty complicated. Stick with Allegro for now. -- |
raja peter
Member #7,835
October 2006
|
Matthew, it is not that "opening" is the image to be loaded. But, it is full screen image(800*600) that is drawn on the screen buffer. file_select box is to be drawn on that image. when the file_select returns, I'll use another bitmap to load the selected image. I think u understand the problem in my code now. luv, raja |
|