Hi there,
I just returned to 3DGS after a couple of years and Lite-C is quite new to me. The best way for me to learn a new programming language is to solve simple tasks, but the one I gave myself now is not quite that simple to me, so I'm asking for help.
I'm trying to use an API-Call to read the first available screen resolution using "EnumDisplaySettings". After a little research I found out that I have to define a structure to contain the returned values of this call. Trouble is, that I don't know how to access the returned values, so I'd appreciate any help.
This is my code so far:
#include <acknex.h> // Pure-Mode
#include <default.c> // Standard-Keys
#include <windows.h> // Windows-API-Calls
typedef struct _devicemode {
DWORD dmBitsPerPel;
DWORD dmPelsWidth;
DWORD dmPelsHeight;
DWORD dmDisplayFlags;
DWORD dmDisplayFrequency;
} SCRMODE;
STRING* rvalue = "Test";
TEXT* doutput =
{
pos_x = 50;
pos_y = 50;
layer = 1;
string (rvalue);
flags = VISIBLE;
}
void main()
{
var rvalue;
d3d_antialias = 1;
video_mode = 8;
video_screen = 2;
wait(1);
level_load(_str("title.wmb"));
SCRMODE* resolution;
rvalue = EnumDisplaySettings(NULL, 0, resolution);
}
So far I don't get any errors, but I don't really know how to put the return value "rvalue" or the members of "resolution" to use. What I like to do is to display rvalue in doutput.string and after a couple of frames to display the given resolution in the same panel in the format "width x height" (e.g. 800x600).
How could I accomplish this. I hope my problem is understandable.
Thanks in advance,
Patrick
PS: I know that EnumDisplaySettings uses a structure with more values of the DEVMODE-Type, but only the five given values are used by EnumDisplaySettings, so I figured that defining only those five needed members should be enough.