Very simple screensaver in VC++

V

Ville Ahonen

I'm just learning C++ and thought I'd program a simple screensaver in
VC++ as my first assignment. I've found some tutorials showing how to
create a screenasver using OpenGL, but I found it very confusing and
perhaps uunnecessarily complex for my needs. What I would like to do is

1) know the dimensions of the screen (eg. 1024x768x32bit)
2) be able to use some sort of framebuffering, i.e. drawing to one frame
while showing the other to avoid flickering
3) perhaps have some timer that would be able to trigger a drawing
method at a frequency matching the refresh rate of the monitor

A reference to a good tutorial or some simple stump of code that draws a
white pixel in the center of the screen would be just perfect. I already
have the rest of the code done, i.e. I am able to produce a vector with
x and y values I'd like to plot on the screen.

Thanks a lot,

Ville
 
E

eddy_ruslim

you need to use wingdi access ie swapbuffer function to do that.
Another way of doing it easy is by just using gdi instead of opengl
because windows hookup to opengl could complicate things.

Edernity
---------
if it help
please help me provide better school supplies for childrenof indonesia.
it may be a donation but I merely ask you to letme send email to you
from one of the product of I'm affiliated and please register there on
mechant account free. If you even want you refund back on your dollar
of i-kard, its ok, I'll send you just use regular delivery on shipping
please. Please note this is very safe since this is a bonafid company.
remember your credit card company will confirm you on your purchase.
Still have doubts, sign on a personal account and let me contact you
again on it.
also
I'm also affiliated to this site:
www.getaportal.com/portals/eddy_ruslim
Ville said:
I'm just learning C++ and thought I'd program a simple screensaver in
 
R

Rolf Magnus

Ville said:
I'm just learning C++ and thought I'd program a simple screensaver in
VC++ as my first assignment. I've found some tutorials showing how to
create a screenasver using OpenGL, but I found it very confusing and
perhaps uunnecessarily complex for my needs. What I would like to do is

1) know the dimensions of the screen (eg. 1024x768x32bit)
2) be able to use some sort of framebuffering, i.e. drawing to one frame
while showing the other to avoid flickering

You mean double buffering.
3) perhaps have some timer that would be able to trigger a drawing
method at a frequency matching the refresh rate of the monitor

It's better to synchronize the buffer swap with the refresh of the monitor
itself.
A reference to a good tutorial or some simple stump of code that draws a
white pixel in the center of the screen would be just perfect. I already
have the rest of the code done, i.e. I am able to produce a vector with
x and y values I'd like to plot on the screen.

You could have a look at SDL (http://www.libsdl.org)
 
E

eddy_ruslim

hi,
agrees with rolf, all those matrix of vectors in opengl could make a
beginner mad.
Bid the best prayer too u all for the continuity of god given world of
computing (this forum :-D)
Best to all
hi rolf, ok to call u that?
What about those donation ? just 1 email, just 1 pls! it could help one
kid 4 1 month
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,775
Messages
2,569,601
Members
45,183
Latest member
BettinaPol

Latest Threads

Top