By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,888 Members | 1,540 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,888 IT Pros & Developers. It's quick & easy.

Very simple screensaver in VC++

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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 Ahonen wrote:
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


Jul 23 '05 #2

P: n/a
Ville Ahonen wrote:
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)

Jul 23 '05 #3

P: n/a
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
Rolf Magnus wrote:
Ville Ahonen wrote:
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)


Jul 23 '05 #4

P: n/a
Thanks for the pointers, the SDL tutorials are just what I need.

- Ville

Rolf Magnus wrote:
Ville Ahonen wrote:

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)

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.