Skip to main content
GameDev.net gamedev.net
🔒 Locked

opengl:how to open a HD window for vc++ 2010 express.

Started by nickme Feb 11, 2012 at 3:19 AM 38 replies 5.7k views
Original Post
nickme
nickme
hi,

i still had problem with openning a window with resolution of 1920x1080. as my included screen-shot shown, the window of mandelbrot was openned with 600x600 resolution, yet, it covered all most from top to bottom. i think there must be my screen resolution set up that did this. i hope i can get constructive advices of how to solve the problem. the mandelbrot window should be ~ 1/3 of the screen (600 ~ 1920/3).

thanks
SimonForsman
SimonForsman
I'm guessing you've messed up your window creation somehow, post the code (or a minimal example that suffers from the same problem)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
nickme
nickme

I'm guessing you've messed up your window creation somehow, post the code (or a minimal example that suffers from the same problem)


the following codes is from my main func


int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition(650, 50);
glutInitWindowSize(600, 600);
glutCreateWindow(" Fractals with Zoom ");

init();
glutIgnoreKeyRepeat(1);
glutDisplayFunc(render);
glutReshapeFunc(winReshapeFcn);
glutSpecialFunc(SpecialKey);
glutKeyboardFunc(processNormalKeys);
glutMouseFunc(mouseButton);
createMenu();

glutMainLoop();
glDeleteTextures(1, &palette_texture);
return 0;
}
Cornstalks
Cornstalks

[quote name='SimonForsman' timestamp='1328940124' post='4911891']
I'm guessing you've messed up your window creation somehow, post the code (or a minimal example that suffers from the same problem)

glutInitWindowSize(600, 600);
[/quote]
Well, you do create a 600x600 window, and your screenshot certainly doesn't look like it came from a 1920x1080 monitor. Are you sure your monitor is set to a 1920x1080 resolution?
SimonForsman
SimonForsman
Hmm that screenshot is: 1 200px × 675px , so if the monitor is set to 1280x720(720p) that would explain everything.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
nickme
nickme
hi


Hmm that screenshot is: 1 200px × 675px , so if the monitor is set to 1280x720(720p) that would explain everything.


yes, the screen resolution of the opengl window is 1280x720. i clicked start->control panel->display, and it showed that the screen resolution is set at 1920x1080. i just don't know what happened.

thanks for the reply.
nickme
nickme
hi

could it possibly be that vc++ 2010 express had something to do with it?
Brother Bob
Brother Bob
Neither OpenGL, GLUT or Visual Studio has anything to do with this. If you ask for a 600x600 window, then that is what you will get. You can get the size of the screen with glutGet and GLUT_SCREEN_WIDTH and GLUT_SCREEN_HEIGHT, and you can check the size of the window in the reshape callback. Those values won't lie. If the size of the screen is reported as 1280x720, then that is the resolution of your desktop. If your display settings says something else, then the problem is elsewhere.
nickme
nickme

Neither OpenGL, GLUT or Visual Studio has anything to do with this. If you ask for a 600x600 window, then that is what you will get. You can get the size of the screen with glutGet and GLUT_SCREEN_WIDTH and GLUT_SCREEN_HEIGHT, and you can check the size of the window in the reshape callback. Those values won't lie. If the size of the screen is reported as 1280x720, then that is the resolution of your desktop. If your display settings says something else, then the problem is elsewhere.


after running the glutGet as you suggested, it showed 1280x720 resolution. if that is my resolution, my point is that what can i do to change to 1920x1080? i checked and rechecked set and reset the desktop setting. but i still have 1280x720. the question is 'how' can i change to hd? if the problem is elsewhere, where and how to change that. i posted this problem before but i did not get the solution but diagnose. i checked the problem on line and it seen mine was unique. i don't know what to do.

i know for sure that my desktop resolution is 1920x1080 because when i printscreen the screen shot above and past it into paint.net to create the png file, it show that the image is 1920x1080.

thanks
Cornstalks
Cornstalks

i know for sure that my desktop resolution is 1920x1080 because when i printscreen the screen shot above and past it into paint.net to create the png file, it show that the image is 1920x1080.

That screenshot is definitely not a screenshot of a 1920x1080 screen. Does your video card support 1920x1080, and if so, are you sure your video card is actually using 1920x1080?


Right click on the desk top and go to Screen Resolution (or whatever the setting is, I can't remember and I'm not on my Windows machine) and actually take a screenshot of what it says your screen resolution is. Post that.
Brother Bob
Brother Bob
How about you take a screen shot of your desktop both with and without the OpenGL window, and post them here at their original resolution. If they are genuinely of different sizes without something changing the resolution, then something is really weird with your system. I really have a hard time believing the behavior you're describing, mostly because it sounds too strange. There is most likely something you have overlooked.
nickme
nickme
hi
here is the screenshot, it is in the attached file. this problem will effects all my project from now on, so you may see how eager and frustrated about this.
Cornstalks
Cornstalks

hi
here is the screenshot, it is in the attached file. this problem will effects all my project from now on, so you may see how eager and frustrated about this.

[s]That screenshot is 1200x675. Not 1920x1080. I've attached a 1920x1080 image so you can see just how big 1920x1080 should be. I'm not sure what's up, but something's screwy on your system.[/s]

[edit]

Turns out GDnet is resizing to 1200x675. Gosh I hate this "click the picture and we give it to you in a fancy overlay" thing.

Anyway, try what BrotherBob said and also take a screenshot with your OpenGL program open. Also download a 1920x1080 image from somewhere and make sure the image properly fits perfectly on your screen.
nickme
nickme
hi

i would like to mention that my video card is GeForce 9100. i checked the web (eHow.com) and it said that Geforce 9100 support VGA max up to 2048x1536 resolution. i don't know what that mean anything to my case.

thanks
nickme
nickme

How about you take a screen shot of your desktop both with and without the OpenGL window, and post them here at their original resolution. If they are genuinely of different sizes without something changing the resolution, then something is really weird with your system. I really have a hard time believing the behavior you're describing, mostly because it sounds too strange. There is most likely something you have overlooked.


i don't know how to post the image with the original res. maybe it is 1920x1080 or maybe not. it is up to editor of this post. i don't know whether it will retain the full res of my png file. but when i save the image with paint.net, i moved the cursor down to lower right corner and it showed the pixels was at 1920x1080. here is the screenshot of a variation of opengl windows.

notice how coarse the picture look when you look at the it. with a higher resolution i can display more detail.

i know that i overlook something, that is why i asked for help.

you can double click the thumb-nail to see an enlarged picture.

thank for the reply.
Brother Bob
Brother Bob
The reason I said you should post at the original resolution was just so there wasn't anything happening between taking the screen shot and posting it here, but I wasn't aware the forum software capped the size so just ignore that then. No point going through unnecessary trouble posting them here at the original size if they are capped so just keep them as they are.

If you rescale the image back to 1920x1080, the window size is 900x900. Are you sure the window really is 600x600 within your program? I would like you to try two things; check the size of the window in the reshape callback (that is the actual pixel-size of the frame buffer, for example by actually inspecting the parameters with a debugger) and then read back the frame buffer and save it to a file. Compare the window and the image; are they the same? Is the window really an enlarged version of the image saved?

If the image and the window are in fact different, then you should start looking at the driver settings or look for other wrappers you have installed that alters the window appearance. Also, does this problem happen with other programs as well (not your own, but other games and such), or is it only your own programs, or just this particular program? This is certainly not a behavior caused by OpenGL or GLUT at least.
nickme
nickme
hi

when i used SDL, it looked ok. i do not play game so i don't know about other graphics programs. i know it is not glut or opengl that caused it but i just dont know what caused it.

how do i look at driver setting? and what is a wrapper? it happened to all the tutorials and examples from books downloaded from the web.

i printf() the glutGet() for width and height in both init() and reshapescreen(), both said the screen resolution was 1280x720 pixels

i don't know how to save from the framebuffer to file sad.png.

i really hope this is not another futile effort.\

update:

i am very sure that the window is 600x600 because in the program, i used glReadPixels() and glDrawPixels(). and the array of the image is of size win_size, such as

GLubyte image[win_size][win_size][3];

which win_size is a const of 600, just like i declared glutInitWindowSize(win_size, win_size); since win_size is declared const, it can not be changed. so, i think i am pretty sure that the window is 600.

by the ways, can someone give me a link to download GeForce 9100 driver? i would like to try that.

thanks
Brother Bob
Brother Bob
The driver settings is in the system control panel. And you can easily check with other programs if you just download some simple game or anything and try. Finally, you find new drivers at the graphics card manufacturer's home page.
nickme
nickme
hi

well,i tried everything. i downloaded the Nvidia GeForce 9100 driver and re-installed the samsung monitor driver. when i run the program, i still got the big windows with 600x600.
Cornstalks
Cornstalks
I don't know why someone --rate my post. These screen shots are definitely *not* screen shots of a normal 1920x1080 screen. I have a 1920x1080 screen, and when I first saw the pictures I knew the text and button sizes in the pictures were way to big to be coming from a normal 1920x1080 screen. I've attached an image that compares nickme's screen shot (on the left, which I resized to 1920x1080 for the comparison) and a screenshot of my own window (on the right). Notice that his window borders, text, buttons, and everything is much larger than mine. The image is originally 2073x713 pixels, in case GD downsizes it and anyone wants to blow it back up to its original size.

I'm not calling nickme a liar, I'm saying this isn't an issue with OpenGL or Visual Studio. Something's screwy with his system, not his program.

[edit]

Just realized the screenshot says my screen is 1440x900. That's my other screen (screen 1). Screen 2 (my primary display) is 1920x1080. Not that that matters in this comparison.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.