However when I run a graphics program from putty I would like the output (graphics screen) to appear on my TV.
Is there a way to do this.. Can you help me
In my case I use 2 displays connected to Rpi, but in your case, you can just pretend there's a second display, & output to HDMI only when you wish to display graphics or video output.
You achieve this by enabling Rpi's very useful DPI mode. Read:
viewtopic.php?f=91&t=94424&sid=b9557b66 ... 1142031329
for more information.
In your case, you don't need to buy any extra hardware. You simply edit
to contain these 3 lines:
The requisite VGA666 overlay will already be present in /boot/overlays
Now, when you reboot, as you have elected to use your non-existent VGA display as the primary screen, there will be no screen output from HDMI, so you will SSH into your Rpi as you do at present.
A quick test to show you this is all working is, via your SSH machine:
omxplayer --display 5 some-videofile.mp4
& your HDMI connected Tv will show the video.
(you can uise the BigBuckBunny.h264 file provided in the "hello_video" examples folder in Raspbian if you don't have a video file handy)
When I started to use 2 displays, I programatically entered the display number (0 for the default HDMI, 1 for the DPI connected display), into my test ptrograms, but later the Foundation provided a useful environment variable:
to allow your graphics application to divert video output to a specific display device. Strangely, this variable mysteriously isn't working at the moment. I'll investigate...
It won't affect what you want to achieve, as it's just a convenience.