Click here to Skip to main content
13,762,523 members
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads


51 bookmarked
Posted 7 Oct 2004

Generating Outlines in OpenGL

, 7 Oct 2004
Using multi-pass techniques to generate outlines in OpenGL.
// OGLDemoView.h : interface of the COGLDemoView class

#if !defined(AFX_OGLDEMOVIEW_H__B1294A49_C25D_4B21_9705_6C704D184C84__INCLUDED_)
#define AFX_OGLDEMOVIEW_H__B1294A49_C25D_4B21_9705_6C704D184C84__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class COGLDemoView : public CView
protected: // create from serialization only

// Attributes
	COGLDemoDoc* GetDocument();

// Operations

// Overrides
	// ClassWizard generated virtual function overrides
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();

// Implementation
	int DrawGLScenePolygonOffset();
	int DrawGLSceneStencil();
	int DrawGLSceneStencilDisplayList();
	int CreateDisplayLists();
	virtual ~COGLDemoView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;

	CWGL m_wgl;
	float m_rtri;
	float m_rquad;
	bool m_bResizing;

	void RenderMesh1();
	void RenderMesh2();
	void RenderMesh3();
	bool m_listCreated;

	enum RenderType {

	RenderType m_renderType;

// Generated message map functions
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnDestroy();
	afx_msg void OnRenderPolygonoffset();
	afx_msg void OnRenderStencilbuffer();
	afx_msg void OnRenderStencilbufferwithdisplaylist();

#ifndef _DEBUG  // debug version in OGLDemoView.cpp
inline COGLDemoDoc* COGLDemoView::GetDocument()
   { return (COGLDemoDoc*)m_pDocument; }


// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_OGLDEMOVIEW_H__B1294A49_C25D_4B21_9705_6C704D184C84__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Dave Handley
Web Developer
United Kingdom United Kingdom
I started programming on 8 bit machines as a teenager, writing my first compiled programming language before I was 16. I went on to study Engineering and Computer Science at Oxford University, getting a first and the University Prize for the best results in Computer Science. Since then I have worked in a variety of roles, involving systems management and development management on a wide variety of platforms. Now I manage a software development company producing CAD software for Windows using C++.

My 3 favourite reference books are: Design Patterns, Gamma et al; The C++ Standard Library, Josuttis; and Computer Graphics, Foley et al.

Outside computers, I am also the drummer in a band, The Unbelievers and we have just released our first album. I am a pretty good juggler and close up magician, and in my more insane past, I have cycled from Spain to Eastern Turkey, and cycled across the Namib desert.

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06-2016 | 2.8.181112.1 | Last Updated 7 Oct 2004
Article Copyright 2004 by Dave Handley
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid