Results 1 to 5 of 5

Thread: Half DC & Half RC

  1. #1
    Guest

    Half DC & Half RC

    Hi,

    Im trying to create a polygon using LineTo() and MoveTo()using the users mouse inputs in a Windows SDI based program in the left half of the screen. This part is already finished.

    And the same polygon using OpenGL slightly shifted from the main polygon on the right hand side....as soon as I try to initialize opengl...my whole screen becomes black..and I cant see anything..inclyding the previous users drawing..(which used to be black on white...) ..I dont know if its being drawn at all..or just overwritten with the black background when i initialize opengl.

    I am completely stuck...I dont seem to be able to understand the RC and DC interconversions..how do I do this ?

    Thanks
    Vikky

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: Half DC & Half RC

    Hi !

    I think you need to post some code because I don't have a clue what you mean, are you trying to use GDI an OpenGL in the same Window ?

    Mikael

  3. #3
    Guest

    Re: Half DC & Half RC

    Yes...I am trying to use GDI and OpenGL in the same window.

    Is it possible ?

  4. #4
    Guest

    Re: Half DC & Half RC

    What I have is a program...to follow the users mouse and draw a polygon using GDI.

    I want to draw the same polygon in the same window...in a different area of the window using OpenGL.

    Any help ?

  5. #5
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: Half DC & Half RC

    Hi !

    You cannot mix GDI and OpenGL if you have doublebuffering enabled, with single buffering it works but you must also set a flag when you create the rendering context to enable it.

    You also need to be aware that glClear() will erase the contents of your window including and GDI stuff, but you can what part of the window should be used by OpenGL, but an easier solution is to draw the OpenGL stuff first and then draw all GDI stuff at the end if that is possible.

    Mikael

Similar Threads

  1. Half suggestion, half reality check
    By Willrandship in forum OpenGL: General
    Replies: 6
    Last Post: 02-07-2010, 12:39 PM
  2. Half Like 2 like water
    By glJack in forum OpenGL: Advanced Coding
    Replies: 15
    Last Post: 03-03-2005, 09:50 AM
  3. half sphere
    By magnuse in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 08-02-2004, 04:00 AM
  4. Half-Life BSP!!!
    By Mihail121 in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 02-25-2003, 08:28 AM
  5. Half-Vectors
    By Liquid in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 07-26-2002, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean